Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Unanswered: SQL - query for multiple view??

    Hi,
    I want to write an SQL query which should return me 2 kinds of outputs depending on which condition is true. i.e.

    the query should be something like

    select someview if (condition1 = true)
    else select someotherview if (condition2 = true)

    where someview is a set of columns from one table only, and someotherview is a set of columns which is a superset of someview (& is generated from two tables, which have no common field)

    Can I write a SQL query like this? Will an outer join help me?

    Thanks & Regards,
    Amit Parmar

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    An outerjoin is simply an inner join with the non-matching tuples included in the result set with null values representing the absent values.

    How does the condition relate to the tables?
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

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