Generate random names in sql

前端 未结 7 1004
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 16:42

I have 5 random names each for male and female. I need to insert random names based on the gender. But how can we insert names in random from a set of 5 names in SQL. Is it

7条回答
  •  借酒劲吻你
    2021-01-06 16:54

    Store the 5 random names for male in one table and the 5 random names for female in another table. Select a random integer between 1 and 5 and cross reference to male or female table using an inner join.

提交回复
热议问题