ALTER PROCEDURE dbo.P_GetUserExpertRecommend AS begin SET NOCOUNT ON ; select exap_id,exap_userid,exap_reason, exap_nicename,exap_playtype,exap_datetime,exap_operatorid,exap_operatordatetime ,exap_operatestatus ,exap_picpath from Tab_ExpertApply end
这个存储过程怎么让他生成 随机的五条信息 谢谢,帮忙解答一下。
select
exap_id,exap_userid,exap_reason, exap_nicename,exap_playtype,exap_datetime,exap_operatorid,exap_operatordatetime ,exap_operatestatus ,exap_picpath from Tab_ExpertApply
order by newid()
newid()函数原理其实是生成一个临时的Guid类型字段,然后以它来排序,因为是随机生成的,所以以它来排序,起到随机的作用
hi men,look look this http://www.jb51.net/article/18517.htm