Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    1

    Unanswered: outer joins and null values

    i've currently got a left outer join of a table and a subquery in the from clause and am wondering its it possible to put values into the null values produced?
    i.e. if the subquery produces an id and a count of a attribute,
    and the table only has the id. How do i put a 'zero' value into it the count column from the resulting join?

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Select NVL(column, 0) from table
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Jan 2004
    Location
    Sochaux (France)
    Posts
    55

    Re: outer joins and null values

    Originally posted by maddog
    i've currently got a left outer join of a table and a subquery in the from clause and am wondering its it possible to put values into the null values produced?
    i.e. if the subquery produces an id and a count of a attribute,
    and the table only has the id. How do i put a 'zero' value into it the count column from the resulting join?
    I don't understand all what you talk about, but i think you can use the NVL or the DECODE function to put a value instead of a NULL one.

    Code:
    Select a.id, NVL(b.count(*), 0)
    from a, b
    where a.id (+) = b.id
    I do't know if it is what u want to do, but it's what i understand....

Posting Permissions

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