Home > other >  separate number digits postgresql
separate number digits postgresql

Time:02-17

i'm trying to find an sql function that can split a number into separate digits. ex. num=78912346 split_num(num)={7,8,9,1,2,3,4,6}

CodePudding user response:

You can use string_to_array with a null delimiter

select string_to_array(78912346::text, null)
  • Related