I have a complex query, but here is the essence of what I'm trying to do
In a table looking like this:
Col1 Col2 Bill 0 Bill 0 Bill 0 Bill 1 Bill 1 John 1 John 1 Jonh 1
The above table has 2 columns. I am trying to query the rows that has '1' in all the rows in column 2. Since 'Bill' rows with '0' and '1', bill must be excluded. Subquery in the WHERE statement gives more than one result, and doen't work.
SELECT t1.Col1
FROM Table1 t1
WHERE t1.Col1 <> (SELECT t1.Col1 FROM Table1 t1 WHERE t1.Col2 <> '0')
Using a form of loop statement in the query would bring a whole new level of headache to my project so I hope any smart person can assist me in my quest.