How to write this query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhushanbagul
    New Member
    • Jun 2007
    • 16

    How to write this query

    Hi,

    I have below table structures
    Id'd Status Id's
    Table A: table_a_id number(10) pk Data: 1 Approved
    status nvarchar2(10)

    Table B table_b_id number(10) pk Data: 1 Paid
    status nvarchar2(10) 2 Unpaid

    Table B: table_c_id number(10) pk Data: 1 1 1
    table_a_id number(10) fk A 2 1 2
    table_b_id number(10) fk B

    Now my question is how can i write query to get coun(*) = 0 from table A if there is record exist in table B with status = 'Unpaid'
    I hope the info. provided above is sufficient.
    Regds,
    Bhushan
  • bhushanbagul
    New Member
    • Jun 2007
    • 16

    #2
    hi

    I have below table structures

    Table A:
    table_a_id number(10) pk
    status nvarchar2(10)

    Data for Table A:
    1 Approved

    Table B
    table_b_id number(10) pk
    status nvarchar2(10)

    Data for Table B:
    1 Paid
    2 Unpaid

    Table C:
    table_c_id number(10) pk
    table_a_id number(10) fk A
    table_b_id number(10) fk B

    Data For table C:
    1 1 1
    2 1 2

    Now my question is how can i write query to get coun(*) = 0 from table A if there is record exist in table B with status = 'Unpaid'
    I hope the info. provided above is sufficient.
    Regds,
    Bhushan[/QUOTE]

    Comment

    Working...