- 論壇徽章:
- 0
|
這段代碼是可以執(zhí)行的- select top 1000 a.id, a.產(chǎn)品默認(rèn)圖片, a.類別名稱, a.產(chǎn)品名稱, 銷售價格=
- case when a.價格屏蔽標(biāo)志 = 2 then null else 銷售價格 end , ROW_NUMBER() over(order by a.id) as num
- from 產(chǎn)品表 a left join (select * from 產(chǎn)品屏蔽表 where 用戶編號=3) b on a.id=b.產(chǎn)品編號
- where a.上架標(biāo)志 = 1 and 產(chǎn)品風(fēng)格 = 10 and a.id not in(select 產(chǎn)品編號 from 產(chǎn)品屏蔽表 where 用戶編號=0 and 價格屏蔽標(biāo)志=1) and 上架下架日期 NOT between DateAdd(dd,-1,getdate()) and '2010-01-01' order by 綜合評價 desc
復(fù)制代碼
QQ截圖20150424171656.jpg (77.74 KB, 下載次數(shù): 31)
下載附件
2015-04-24 17:18 上傳
但是被select * from ()包含進(jìn)去后就報 ')' 附近有語法錯誤。- select * from (select top 1000 a.id, a.產(chǎn)品默認(rèn)圖片, a.類別名稱, a.產(chǎn)品名稱, 銷售價格=
- case when a.價格屏蔽標(biāo)志 = 2 then null else 銷售價格 end , ROW_NUMBER() over(order by a.id) as num
- from 產(chǎn)品表 a left join (select * from 產(chǎn)品屏蔽表 where 用戶編號=3) b on a.id=b.產(chǎn)品編號
- where a.上架標(biāo)志 = 1 and 產(chǎn)品風(fēng)格 = 10 and a.id not in(select 產(chǎn)品編號 from 產(chǎn)品屏蔽表 where 用戶編號=0 and 價格屏蔽標(biāo)志=1) and 上架下架日期 NOT between DateAdd(dd,-1,getdate()) and '2010-01-01' order by 綜合評價 desc)
復(fù)制代碼 |
|