Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

display different sort order for each execution

$
0
0
Hello all,i would like to know if there is a way to display results in random order for each execution. [code="sql"]/*-------------------------Drop temp table-------------------------------------------*/IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp; create table #temp (col1 int, col2 varchar(4)) insert into #temp select 7, 'AB' UNION SELECT 2, 'CD' UNION SELECT 9, 'JQ' UNION SELECT 12, '3A' UNION SELECT 3, '8D' UNION SELECT 1, 'ER' SELECT * FROM #TEMP[/code]i want to display results in different sort order each time is it possible?

Viewing all articles
Browse latest Browse all 3145

Trending Articles