mysql - How to count for each row using other table in SQL? -


i have 2 tables: book table , author table. need count each author how many book registered in book table. how that?

select *,        (select count(dbo.book.id)           dbo.book          dbo.book.authorid = dbo.author.id) numberofbooks   dbo.author  

you must connect 2 tables id, can find out relation of 2 tables.


Comments