I have the following Postgres syntax, that does what I want it to do, however, I would like to implement it in the models.py tab in ORM.
SELECT split_part(booking_inform, ',', 1) AS col1
, split_part(booking_inform, ',', 2) AS col2
, split_part(booking_inform, ',', 3) AS col3
, split_part(booking_inform, ',', 4) AS col4
, split_part(booking_inform, ',', 5) as col5
, split_part(booking_inform, ',', 6) as col6
FROM main_inmate;
I am splitting the column "booking inform" into six new columns based on a commas.
Thanks!