Query to fine blank records

dolphine4u's Avatar, Join Date: Jul 2012
Newbie Member
Hi All,

I have a table with column Part_no, Revision, Alternative & Preferred

Table data as below

PART_NO REVISION ALTERNATIVE PREFERRED
11000162 1 1 1
11000162 2 1 1
11000162 3 1 1
11000162 4 1 1
11000162 4 2 0
11000162 5 1 1
11000162 5 2 0
11000162 6 1 1
11000162 6 2 0
11000162 7 1 1
11000162 7 2 0
11000162 8 1 1
11000162 8 2 0
11000162 9 1 1
11000162 9 2 0
11000162 10 2 0

In above data you see part no has 10 revision where few revision has 1, 2 alternative and 1 alternative has preferred 1 & 2 alternative has preferred 0 so i want a query which check preferred only 0 how can i get this.
Note: if alternative 1 preferred is 0 and if alternative 2 has 1 then i dont want to fetch such record. I want the output to show only prefererred 0.
It should check how many alternative it has and all alternative should be 0 then only that revision data has to be displayed pls help

TIA
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
>>In above data you see part no has 10 revision where few revision has 1, 2 alternative and 1 alternative has preferred 1 & 2 alternative has preferred 0 so i want a query which check preferred only 0 how can i get this.

Well, I know YOU know what that means, cos you wrote it, but it makes no sense to me. Please split it into simple facts, for example:
In above data you see part no has 10 revision where:

few revision has 1, 2 alternative,
1 alternative has preferred 1;
2 alternative has preferred 0

- or whatever it's meant to be.

>>i want a query which check preferred only 0

Again that doesn't make a lot of sense. Can you give the output you want to see from the query, for example should it be:

PART_NO REVISION ALTERNATIVE PREFERRED
11000162 4 2 0
11000162 5 2 0
11000162 6 2 0
11000162 7 2 0
11000162 8 2 0
11000162 9 2 0
11000162 10 2 0

or something else?