联表查询,多表查询

@Select(“SELECT c.uid,a.content,a.titles,c.stat,COUNT() from comment as c LEFT JOIN article as a ON a.id=c.uid WHERE c.uid in (SELECT a.id FROM article as a WHERE a.userid=#{userid} AND a.titles=#{titles}) group by c.uid,c.stat having count() > 0”)


List commentCount(Article Article);

猜你喜欢

转载自blog.csdn.net/qq_35577329/article/details/94741369