Results 1 to 4 of 4

Thread: Need Help in Select Query

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Need Help in Select Query

    I have two tables named TBL_PAYMENT_TRN & TBL_PROFIT_PETROLEUM_TRN. I want to select all the records from the table TBL_PROFIT_PETROLEUM_TRN & the matching records from TBL_PAYMENT_TRN.

    In Figure 1 ,TBL_PAYMENT_TRN is dere.
    In Figure 2,TBL_PROFIT_PETROLEUM_TRN is dere.
    In Figure 3, See my Select Query Result

    Code:
    select TBL_PAYMENT_TRN.UTR_DD_NO,TBL_PROFIT_PETROLEUM_TRN.ACCOUNT_ID from TBL_PROFIT_PETROLEUM_TRN,TBL_PAYMENT_TRN where TBL_PROFIT_PETROLEUM_TRN.ACCOUNT_ID= TBL_PAYMENT_TRN.TRANSACTION_ID
    AND
    TBL_PAYMENT_TRN.TYPE_OF_PAYMENT_ID=3
    In TBL_PAYMENT_TRN one entry is made against ACCOUNT_ID of TBL_PROFIT_PETROLEUM_TRN. So above query selects dat.

    In TBL_PROFIT_PETROLEUM_TRN another entry is dere for ACCOUNT_ID - 378. I also wnat to select dat record & if there is no corresponding record in TBL_PAYMENT_TRN against dat ACCOUNT_ID,I want the null to come.

    How to do that!Help me out.

    I want the query in Oracle Plz Reply.

    I want the output to be like
    Code:
    UTR_DD_NO   ACCOUNT_ID
    utr1              379
    null               378
    Attached Images Attached Images    

Posting Permissions

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



Click Here to Expand Forum to Full Width