I have posted a similar question. Here is another one.
My sql statement with ACCESS is like this:
------------------------------------
SELEC email FROM tblA
WHERE IIF(EXISTS(SELECT username FROM tblB WHERE username='ABC'),tblA.username='ABC',true)
-----------------------------------------
Basicly, it says, if username 'ABC' exists, get its email, otherwise, return all emails.
This is a valid statement for ACCESS. I am having a difficult time to convert it to SQL7.
The real sql is much more complicated than this one. What really matters is:
How can I add a condition in the WHERE clause based on another condition.
I cannot find a right way to handle it using CASE..WHEN statement.
Help please?
My sql statement with ACCESS is like this:
------------------------------------
SELEC email FROM tblA
WHERE IIF(EXISTS(SELECT username FROM tblB WHERE username='ABC'),tblA.username='ABC',true)
-----------------------------------------
Basicly, it says, if username 'ABC' exists, get its email, otherwise, return all emails.
This is a valid statement for ACCESS. I am having a difficult time to convert it to SQL7.
The real sql is much more complicated than this one. What really matters is:
How can I add a condition in the WHERE clause based on another condition.
I cannot find a right way to handle it using CASE..WHEN statement.
Help please?