If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Problems with null values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-04, 13:21
andreasberglind andreasberglind is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
Problems with null values

I´m having problems creating a query.
I have a table with the following fields:
patchbayLineout,summary,lineBoxName,effectid,compr essorID,preAmpID,synthID,mixingConsoleID,drumMachi neID.
On the same row as PatchBayLineOut, the part connected there should have its name showing. In the table, the ID is present. For instance, a LineOut that has a Linebox connected contains LineBoxID, and NULL in all the other places.

The output I want is this:

1, Summary text, LB.Name, null, null, null, null, null, null
2, Summary text, null, E.Name, null, null, null, null, null
3, Summary text, null, null, C.Name, null, null, null, null
4, Summary text, null, null, null, PA.Name, null, null, null

Can anyone help me?
Reply With Quote
  #2 (permalink)  
Old 02-06-04, 07:26
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Problems with null values

I think you want to perform a lot of outer joins like this:

select t.id, t.summary, lb.name, e.name, c.name, pa.name, ...
from t
left outer join lb on lb.id = t.lb_id
left outer join e on e.id = t.e_id
... etc.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On