我有一个像这样的查询
select user_id ,'abc' as user_name from t_user where user_refId=123
,我想在这里再添加一个子句,例如
select user_id ,
'abc' as user_name
select count(user) from users as user_num
from t_user where user_refId=123
这行不通。
select user_id,
'abc' as user_name,
(select count(user) from users) as user_num
from t_user
where user_refId=123
请将'abc' as user_name
andselect count(user) from users as user_num
语句分开,","
并将第二个语句放在括号中,如(select count(user) from users) as user_num
.
select user_id,
'abc' as user_name,
(select count(user) from users) as user_num
from t_user where user_refId=123;