Subject | RE: [firebird-support] nested join sql help |
---|---|
Author | Helen Borrie |
Post date | 2003-09-07T14:35:57Z |
At 03:17 PM 7/09/2003 +0100, you wrote:
you're making this a lot harder than it is!
select n.UserID, b.text from Bugs b
left join Notifications n
on b.id=n.BugID
where
....
and n.UserID = 'T'
will restrict the result set to just those involving 'T'.
But it's not clear whether in fact you want all rows where
>select n.UserID, b.text from Bugs b left outer join Notifications n onPete,
>b.id=n.BugID
>
>except that i need to specify a where clause so that non-null data is only
>returned in this column for a given user in the Notification data. e.g.
>for user 'T'
>
>UserID Text
> T Bug1
> <null> Bug2
> T Bug3
>
>i've experimented with 'union'ing 2 queries together using where
>n.UserID='T' and where n.UserID<>'T' but still not got what i want.
you're making this a lot harder than it is!
select n.UserID, b.text from Bugs b
left join Notifications n
on b.id=n.BugID
where
....
and n.UserID = 'T'
will restrict the result set to just those involving 'T'.
But it's not clear whether in fact you want all rows where