0
movie: id, user, title
thank: id, user, movie
私は必要なものを特定のユーザーに作られた感謝のカウントを取得することです。
movie: id, user, title
thank: id, user, movie
私は必要なものを特定のユーザーに作られた感謝のカウントを取得することです。
は
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;
約
SELECT COUNT(*) FROM thank WHERE user='specific user';