October 22, 2024
Chicago 12, Melborne City, USA
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

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video