Home Forums SQL Server 2005 T-SQL (SS2K5) Random account selection for each staff person RE: Random account selection for each staff person
adam-639168
Default port
Points: 1444
More actions
October 9, 2012 at 3:55 pm
#1547390
Looks like I just figured out my own problem. Here's my solution. Just closing the loop.
SELECT staffid,account FROM
(select
ROW_NUMBER() OVER(PARTITION BY staffid ORDER BY newid() ) AS RowID
, * FROM #accounts ) InnerQ
WHERE InnerQ.RowID <= 3