Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    3

    Unanswered: 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?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •