有两张表
课单表: t_book 字段: id userId
课件表: t_lesson 字段: bookId
t_lesson.bookId 关联了 t_book.id
现在的方法是分开两条SQL查询
查询用户课单: select * from t_book where userId = 2
查询课件数量: select count(*) from t_lesson where bookId = 1
请问如何合并成一条SQL?
å¯ä»¥è¿æ ·ï¼
select count(*)æé纳ï¼è°¢è°¢