[thelist] MS SQl help ASAP

Matt Warden mwarden at gmail.com
Tue Jan 4 14:40:52 CST 2005


Brian,


On Tue, 04 Jan 2005 15:01:37 -0500, Brian Cummiskey <Brian at hondaswap.com> wrote:
> i need some quick help, please answer as soon as you can if you have any
> ideas.
> 
> i have a query which is simple-
> 
> select * from blah
> where blah = 1
> and isnumeric(PersonalIdentifier) = 1
> 
> which works great.
> 
> however, the opposite is killing me.  i cannot figure out a way to query
> on the non-numeric data.
> 
> The table/program is set up so that numbers 0-100 are positive
> responses, and any alpha text is a refusal.

DeMorgan's Laws:


NOT (A and B) = NOT(A) or NOT(B)


So, try this:

select * from blah
where blah != 1
or isnumeric(PersonalIdentifier) != 1

or, equivalently:

select * from blah
where blah != 1
or isnumeric(PersonalIdentifier) = 0

That is the opposite, but you will have to think for a minute whether
you actually want the opposite, and not something like this:

select * from blah
where blah != 1
and isnumeric(PersonalIdentifier) = 0

(note the and)


More here about formal logic, if you're interested:
http://www.google.com/search?hl=en&q=demorgan%27s+law


hope this helps,







-- 
Matt Warden
Miami University
Oxford, OH
http://mattwarden.com


This email proudly and graciously contributes to entropy.


More information about the thelist mailing list