I’m a novice when it comes to sql so forgive me if this seems obvious.
I’ve looked over all the answers that I’ve found here and tried to adapt them to work with my data but for some reason the results are never correct.
I simply want to extract the data in an ordered list with parents (records with 0 for parent_id) with each ones siblings underneath it.
I can’t post images yet as i’ve not been a member long enough but my table structure is quite simple.
id, subject, parent_id
Subjects that are parents have a parent_id of zero.
Thanks
Steve
PS: I tried this solution but it didn’t work correctly for me. join with same table in mysql?
Something like