newid()

代码

select   top   5   *   from   ItemProfileCommonInfo   order   by   newid()   

set statistics profile on
SET NOCOUNT ON;
select  top 6   a.[name],a.description,a.categoryid from dbo.ItemProfileCommonInfo a with(nolock)
where  a.Editdate>(getdate() -100and  a.categoryid in (select categoryid from ItemCategory with(nolock) where description like N'%%' 
or description like N'%%')
order by newid()




select  top 6   a.itemcode,a.[description],b.PriceFinal,a.ImageNameFull from ItemProfileCommonInfo a with(nolock)
 
join ItemProfilePriceSetting b with(nolock) on a.itemcode=b.itemcode 
where  a.Editdate>(getdate() -100and  a.categoryid in (select categoryid from ItemCategory with(nolock) where description like N'%%' 
or description like N'%%')
order by newid()

 

posted @ 2010-05-11 13:50  paymob  阅读(177)  评论(0编辑  收藏  举报