Can neone help me in following scenario: I have a table with these specifications: table1(part_number, part_status, part_condition) part_status can be either 1 or 2 where 1=Available part and 2=Unavailable part. part_condition ranges between 1 to 3. can anyone tell me how to write a query that gimme "available" parts in all "3" conditions. I used this one but didn't get the valid result: select Part_Number from table1 where part_status = 1 AND part_condition IN (1,2,3)
The only filtering is on part_status = 1. Because the value on the part_condition column is irrelevant to the filtering, you simply should not mention that column in the WHERE clause. My best guess why you're not seeing certain rows is that the part_condition column is perhaps nullable, and the missing rows have a null on the part_condition column.
[quote user="Adriaan"] My best guess why you're not seeing certain rows is that the part_condition column is perhaps nullable, and the missing rows have a null on the part_condition column. [/quote] My guess would be, that this is a homework...