Answers for "mysql select count with join"

SQL
3

select count from table mysql

SELECT COUNT(*) FROM count_demos;
Posted by: Guest on November-24-2020
1

mysql select and count left join

select
  t.Topic,
  t.Title,
  count(distinct s.starID) as StarCount,
  count(distinct m.User) as UserCount,
  count(distinct m.messageID) as MessageCount
from
  Topics t
  left join Messages m ON m.Topic = t.Topic
  left join Stars_Given s ON s.Topic = t.Topic
group by
  t.Topic,
  t.Title
Posted by: Guest on April-27-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language