mysql中根据A表的ID查询B表数据

2025-03-24 05:59:14
推荐回答(1个)
回答1:

SELECT id, name, (SELECT comment_id, title, content FROM B WHERE user_id = A.id ORDER BY create_time DESC LIMIT 1) FROM A;