请教一个求和的sql语句,马上给分
我写的一个sql句
select t_trade.price,t_trade.tradename,sum(t_orderdish.amount) as total_amount,sum(t_trade.price) as total_price from t_orderdish,t_trade where t_orderdish.tableindex='"&tableindex&"'
and t_orderdish.tradeid=t_trade.tradeid
GROUP BY t_trade.price,t_trade.tradename
任取一个tableindex值
得到一下结果
price tradename amount totalprice
1200.0000 xo 1 1200.0000
1200.0000 白兰地 2 2400.0000
20.0000 花生 1 20.0000
20.0000 卡布其洛 1 20.0000
15.0000 烈焰红唇 2 30.0000
1200.0000 人头马 13 15600.0000
20.0000 喜力 1 20.0000
能否在同一个sql句中求出sum(totalprice)呢
就是求出查询结果中所有totalprice 的和呢??
感激中~~~