Query

  • Hi

    I have below data and i want if both Sale & Purchase = 'N' then that record should not be displayed

    Item   Name Purchase Sale

    1          AB           Y             N

    2         BC           N             Y

    3          DE          N            N

    In below case 3 record should not get displayed

    Thanks

  • SELECT *
    FROM myTable
    WHERE NOT(Sale = 'N' AND Purchase = 'N')

    SELECT *
    FROM myTable
    WHERE (Sale <> 'N' OR Purchase <> 'N')

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply