我有一个像
这样的查询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
这不成功。
答案 0 :(得分:1)
select user_id,
'abc' as user_name,
(select count(user) from users) as user_num
from t_user
where user_refId=123
答案 1 :(得分:0)
请在'abc' as user_name
之间分隔select 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;