|
Didn't work and didn't return any data are two different issues; it's possible that, as far as the database knows, there are no members who meet your criteria. ( Canceled? )
Your second query is either the right format, or a lot closer; if disable and resign are character/text data types, then it's right. But if they're numeric, you don't need to put the zero in quotes.
In SQL, every clause in your WHERE ( or HAVING ) statement needs to be connected with and or or, like this:
Select *
From members
Where
disable > 0
And resign > 0
You could replace the and with an or, and get anybody who matches one, but not necessarily both, of the statements. You could get really complex and include both:
Where
(disable > 0 And resign > 0)
Or (flagged = 1)
In general you want to avoid huge, complex where clauses because they're more difficult to debug, and because using "or" in certain ways can force a table scan. But SQL allows this, so if you want to test two conditions in your query, you need to give the database a way to evaluate both fields.
|