Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Mysql 我如何将这两个命令合并为一个?
select id from User where name='name' select count(*) from Msg where user_id=@id
您可以加入表格:
SELECT COUNT(*) FROM User a INNER JOIN Msg b ON a.id = b.user_id WHERE a.name = 'name'