Pergunta

For testing an algorithm I would like to generate 10,000 random birthdates from 01/01/1995 to 31/12/2013. Can this be done in SQL and how?

Thank you in advance

Foi útil?

Solução

To generate a random date:

select cast(cast(RAND()*100000 as int) as datetime)

You can then write code around this statement to limit it to a range.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top