Jump to content

msxgames

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

msxgames's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thx for the answer. I already solved this issue in PHP, but this solution is quite ugly. I was hoping to use one (difficult?) query.
  2. I have a table \"cars\" like this example: ID name parent description 1 VOLVO (NULL) Volvo 3 70 2 Volvo S70 6 C 1 Volvo C? 2 S 1 Volvo S? 5 60 2 Volvo S60 4 60 6 Volvo C60 There is a parent/child relationship like this: Volvo (parent) -- S (1st level child) ----60 (2nd level child) ----70 (2nd level child) -- C (1st level child) ----60 (2nd level child) This is actually the order I also would like to end up with, so: ID parent 1 (NULL) 2 1 5 2 3 2 6 1 4 6 Can anyone tell me how my SQL query should look like: SELECT ID, parent FROM cars ORDER BY ???? Or any other solution with UNIONS or JOINS? Thx. [/b]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.