Heim > Fragen und Antworten > Hauptteil
【Stern-Sternliste】
ID-Name
Es gibt N Sterne, selbstinkrementierende ID
【Singliedliste】
ID-Name Star_ID
N mehrere Songs
【Filmliste】
ID-Name Star_ID
N mehrere Filme
Fragen Sie ab, wie viele Lieder und Filme jeder Stern insgesamt hat
Name cout_sing count_movie
代言2017-06-30 09:56:49
select conut(tb1.id) as singnum
from star as tb3
left join sing as tb1 on tb1.starid=tb3.id
where tb3.id=somenoe
迷茫2017-06-30 09:56:49
select a.name,count(b.id) as singnum,count(c.id) as movienum
from star as a
left join sing as b on a.id=b.star_id left join movie as c on c.star_id=a.id group by b.id,c.id.