Results 1 to 2 of 2

Thread: Challenging query

  1. #1
    Join Date
    Jul 2010
    Posts
    1

    Challenging query

    Dear Query Gurus,

    Hope you are doing great.Its a simple query to retrieve data with the Order_ID.If the record is there its fine and can retrieve the data.

    But my query is to retrieve the list of order_id which has no records in database.

    Plz help me to write a query.


    Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Not clear what you want to get. Is your query running against one table or multiple tables with a join?

    You can't retrieve something that is not there. But you can join two tables with outer join to retrieve data with no corresponding data in joined table.

    If it is just one table and you want null rows, you may use inline view with all the order_id, then outer join with the table.

Posting Permissions

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