-1

私は次のようなクエリがあります

select user_id ,'abc' as  user_name from t_user where user_refId=123 

、ここにもう1つの句を追加したい

select user_id ,
'abc' as  user_name
select count(user) from users as user_num
 from t_user where user_refId=123 

これはうまくいきません。

4

2 に答える 2

1
select user_id,
      'abc' as user_name, 
       (select count(user) from users)  as user_num
from t_user 
where user_refId=123 
于 2012-06-21T08:10:07.100 に答える
0

'abc' as user_nameselect count(user) from users as user_numステートメントを区切り、 ","2 番目のステートメントを のように括弧で囲んでください(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;
于 2012-06-21T08:14:51.890 に答える