如何在 mysql 中合并这两个查询?
select count(*) as entry_count from tbl_entries where user_id = x
和
select username, avatar from tbl_users where user_id = x
我想要一个结合这 2 个查询结果的结果。请帮帮我!
谢谢!
最佳答案
select username,
avatar,
(select count(*) from tbl_entries where user_id = x) as entry_count
from tbl_users
where user_id = x
关于php - mysql select count 与另一个 select count,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9273607/