JOIN to same table
Posted on 1998-12-09
I have table that has several colums but only important ones are ID and Parent_ID.
I'd like to greate JOIN between two tables that returns every ID in table ordered so that after line that has Parent_ID = 0 there comes every single line that has Parent_ID equal ID to one that had Parent_ID = 0 (preferably sorted by date-field)
So if I've understood this correctly this is "zero or one or many" relationship to same table.
Everything should come out with single query because it would give me best performance.
I'm using SQL Server 6.5 and Cold Fusion 3.11.
Application is one kind of discussion forum.