Also, you wind up with really odd looking queries when you have to find things that aren't related. What would be a simple left join on two tables becomes a bit ugly with three or four, and you've got a half dozen or more, they get ugly SUPER fast. Here's one I was working on today...
select * from (
select
m.hostname,
't' as yn
from machines m
join mtou on
( mtou.machineid=m.id)
join users u on
(u.id=mtou.userid AND mtou.machineid=m.id)
where username='$username'
union
select m.hostname,
'f' as yn
from machines m
where hostname
not in (
select
m.hostname
from machines m
m.hostname
from machines m
join mtou on
( mtou.machineid=m.id)
join users u on
(u.id=mtou.userid AND mtou.machineid=m.id)
where username='$username'
)
) as a
order by 2 desc,1;
Just in case you're wondering, it finds all the machines that ARE linked to a user, and all the machines that aren't and returns the set fo I can build an html form for editing that relationship. woohoo! (took me about 10 minutes to come up with it, and that was fast, normally it's more like 30)