i'm trying to select distinct number from a table, i think sql can do that, but don't know how,
TableA:
No. Status
1 Y
1 Y
1 Y
2 N
2 N
3 Y
3 N
3 Y
i want to get distinct number which have all 'Y' status, the result should be 1, No. 3 should not be selected, anybody could help me to have a look my code, how to change it to get the result i want? thanks million!
SELECT DISTINCT(No)
FROM TABLEA
WHERE Status = 'Y'
TableA:
No. Status
1 Y
1 Y
1 Y
2 N
2 N
3 Y
3 N
3 Y
i want to get distinct number which have all 'Y' status, the result should be 1, No. 3 should not be selected, anybody could help me to have a look my code, how to change it to get the result i want? thanks million!
SELECT DISTINCT(No)
FROM TABLEA
WHERE Status = 'Y'