Pregunta

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

¿Fue útil?

Solución

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 bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top