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
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ù)制代碼
作者: 姚福堅 時間: 2015-05-13 11:37
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) tmp
要加個臨時表名