大家帮我看看这句ASP语句错在哪里,在线等

dd_cmd.CommandText = "SELECT *,sum(price) as Money FROM T_order WHERE username = ?"
2026年09月11日 18:35
有2个网友回答
网友(1):

SELECT *, (SELECT SUM(price) AS Money FROM ** where .......)FROM XXXX where username = ?"

网友(2):

聚合函数 sum  应配合 group by 使用



select id,sum(price) as Money from t_order where username=? group by id

除sum 以外 有几个 字段 就要 group by 几个字段

select id,username,sum(price) as Money from t_order where username=? group by id,username

另外 ?是字符 应该 
username='..具体内容...'