SELECt子句的一部分)。在这种情况下,您只能从此类查询中选择一列。
考虑
users改为加入表;在选择所需的列时,这将为您提供更大的灵活性
users。
SELECTtopics.id,topics.name,topics.post_count,topics.view_count,COUNT( posts.solved_post ) AS solved_post,users.username AS posted_by,users.id AS posted_by_idFROM topicsLEFT OUTER JOIN posts ON posts.topic_id = topics.idLEFT OUTER JOIN users ON users.id = posts.posted_byWHERe topics.cat_id = :catGROUP BY topics.id
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)