String sql = "select *,T.createdBy_id,(select count(*) from subscription S where S.topic_id=T.id) as subscriptionCount,"+
"(select count(*) from resource R where R.topic_id=T.id) as topicCount from topic T "+
"WHERE T.createdBy_id=6";
如果我在mySQL shell上执行相同的查询,它可以正常工作。 很久以来我一直在尝试这个。帮助赞赏