表1 booking:
show_id
1
2
3
表2 show
show_id name venue_id
1 qq 1
2 ww 2
3 tt 1
表3
venue:
venue_id location capacity
1 london 1
2 newyork 2
把三个表做连接
show_id name venue_id location capacity
1 qq 1 london 1
2 ww 2 newyork 2
3 tt 1 london 1
怎么样写sql语句才能得到在相同location的记录数目?
即 london =2
newyork=1
------解决方案--------------------------------------------------------
- SQL code
select location,count(*)from venue,showwhere venue.venue_id=show.venue_idgroup by location