OiO.lk Blog SQL Generate a Series of Numbers
SQL

Generate a Series of Numbers


I am trying to generate random serial numbers in PostgreSQL with some conditions.

  1. The numbers need to start with the same 3 letters, YAK.
  2. After YAK, there needs to be 8 random digits.
  3. I only need to do 10 iterations of this.

I know I should try to start with generate_series() but can I use RANDOM() in there at all like I probably would for python?



You need to sign in to view this answers

Exit mobile version