Hi All,
I have a requirement to generate unique numbers up to 7 digits but they must be padded with 0. Please help me doing this in SQL.
Expected output
0000001
0000002
…
…
9999999
This is how I am trying to do but it always error out -
LPAD(ROW_NUMBER ()
OVER (
ORDER BY c1 DESC
)), 7, '0')