php – mysql选择计数与另一个选择计数

我怎样才能在 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

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...