declare @cns table(ID int) declare @stocks table(ID int) insert into @cns (ID) select [ID] from [dbo].cate_nid_find_tree('type','795',1,1) insert into @stocks (ID) select [ID] from [dbo].cate_nid_find_tree('kho','778',1,1) select * from [Products] where
[Combo]= '' and status like '%2%' and 0
<(select top 1 ID from @cns as b, [dbo].[Split]([Type], ',') c where b.ID=c.splitted) and 0<(select top 1 ID from @stocks as b, [dbo].[Split]([OnStocks], ',') c where c.splitted='*' or b.ID=c.splitted) order by [RenewDate] desc
declare @cns table(ID int) declare @stocks table(ID int) insert into @cns (ID) select [ID] from [dbo].cate_nid_find_tree('type','795',1,1) insert into @stocks (ID) select [ID] from [dbo].cate_nid_find_tree('kho','778',1,1) select top 3 * from [Products]
where [Combo] like N'%"Id":{[ID]}%' and 0
<(select top 1 ID from @cns as b, [dbo].[Split]([Type], ',') c where b.ID=c.splitted) and 0<(select top 1 ID from @stocks as b, [dbo].[Split]([OnStocks], ',') c where c.splitted='*' or b.ID=c.splitted) and IsPublic=1 order by [RenewDate] desc
--%>
<%----%>
<%--
declare @cns table(ID int)
declare @stocks table(ID int)
insert into @cns (ID) select [ID] from [dbo].cate_nid_find_tree('type','795',1,1)
insert into @stocks (ID) select [ID] from [dbo].cate_nid_find_tree('kho','778',1,1)
select * from [Products] where
[Combo]= '' and status like '%2%'
and 0<(select top 1 ID from @cns as b, [dbo].[Split]([Type],',') c where b.ID=c.splitted)
and 0<(select top 1 ID from @stocks as b, [dbo].[Split]([OnStocks],',') c where c.splitted ='*' or b.ID=c.splitted)
order by [RenewDate] desc
--%>