I have a table like this:
SELECT
parent_id,
parent2_id,
parent3_id,
parent4_id
FROM
parents
I need to make it like this:
I need to add column with an unique value of a row, but since we have 4 columns, then there are four rows. But, if anyone can make this result table without zero value in id column, it would be very cool.
upd: I found an answer, but it seems very large. Can the solution be simplified?