[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Theoretical question... very simple but complex problem dealing with negation.



I have a table entitled MyTable. It has only one field, MyKey.

There are only three records in the table with MyKey values of 1, 2 and 3 
respectfully.

Write a SQL statement that RETURNS NO RECORDS when you successfully find a key 
value (aka, where MyKey = 2).

Concurrently, the SQL should return one and only one record or data element 
(ie, select 'x') when the key value does not exist (aka, something should be 
returned when you test for MyKey = '7').


I have a much more complex problem but this simple version sheds some light on 
the issue I am facing.  If someone knows how to address this, I would be 
interested in your solution.

-Ken



Ken Boettger
boettgek@cwu.edu
http://www.cwu.edu/~boettgek
x2944