We often get requests to do competition draws. A vendor supplies the data and we need to randomly draw a winner using Teradata. We do get audited on our competition draws so the draw needs to be truely random.
Unfortunately often our data is recieved as below example;
- Create another table with two columns, one auto-generated identity, other MSN value. - Insert "Number_of_Entries" times the MSN value in the newly created table. - Select the winner using RAND, ROW_NUMBER or RANK function (on auto-generated column).