首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

求一条SQL语句,很简单,该如何处理

2012-04-01 
求一条SQL语句,很简单select (select sum(Quantity) from OrderProcList c where c.productguida.guid) Q

求一条SQL语句,很简单
select (select sum(Quantity) from OrderProcList c where c.productguid=a.guid) Quantity from menutable a where userguid='2' 

我本来是要求Quantity和但是如果两边GUID不对就显示NULL,但我想没有的时候显示0应该怎么写啊

[解决办法]
select isnull((select sum(Quantity) from OrderProcList c where c.productguid=a.guid),0) Quantity

热点排行