-1
  1. i have a column full of resort id's say 44 rows, i am using the following query

  2. Query-> SELECT DISTINCT RESORT ID FROM Schema.table Name WHERE Condition='Value' AND ROW NUMBER= 1

  3. the above query returns one value say='15'

  4. when i run it multiple it is returning the same value ='15'!!!

  5. i require a different value each time the query is ran

  6. could any one please help me out.

  7. Thanks,

Jesuraja
  • 3,774
  • 4
  • 24
  • 48

1 Answers1

0

You will get Random Resort ID by using this

SELECT    TOP 1 ResortID FROM TableName
-- WHERE     <Condition>
ORDER BY  NEWID() ASC
Jesuraja
  • 3,774
  • 4
  • 24
  • 48