Backboards: 
Posts: 164
In response to "TFW you send 60 minutes wrestling with a SQL query and you're still not even sure why it works now (geek overload)" by oblique

on the first one your join is on id to parent_id. "where id not in [parent_id's]". And wouldn't a left join work?

select
*
from
table t
left join othertable ot
on ot.id = t.id
where
ot.id is null


That should give you everything from table where the ID is not set


Responses:
Post a message   top
Replies are disabled on threads older than 7 days.