سؤال

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

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top