日期:2014-05-18  浏览次数:20561 次

一个SQL自连接的语句
一个购物系统的语句
orders为订单表,CusID为客户编号,ComID为商品编号,amount为购买数量,payamount为付款总金额,
select a.CusID,a.ComID,a.amount,a.payamount from orders as a,orders as b where b.payamount=a.amount*100
这条语句的功能是否是查询单价为100的商品的数量,如果不是,请说明理由;如果是,请详解! 谢谢

------解决方案--------------------
你这样会选出很多重复数据。
建议这样用
SQL code
select *from orders where payamount=amount*100