2011-05-16 5 views

答えて

1

select count(*) from `thank` t join `movie` m on t.user=m.user 
    where m.user='<specific_usr>'; 

であってもよいし、しようと、同じフィールドを持って、両方の場合は、なぜ単に

select count(*) from `thank` where user='<specific_usr>'; 

を使用していないか、あなたが望むならば、すべてのユーザに対してカウント:

select user,count(*) from `thank` group by user; 
1

SELECT COUNT(*) FROM thank WHERE user='specific user'; 
関連する問題