Help with constructing a conditional SQL statement
Posted
by Stefan Åstrand
on Stack Overflow
See other posts from Stack Overflow
or by Stefan Åstrand
Published on 2010-05-21T17:45:22Z
Indexed on
2010/05/21
17:50 UTC
Read the original article
Hit count: 472
Hello,
I want to construct a SELECT statement with a conditional IF.
Like, IF there is no records with the language code 'Swedish'
:
SELECT * FROM Entries WHERE Language = 'Swedish'
THEN use 'English'
SELECT * FROM Entries WHERE Language = 'English'
How would I construct this statement using MSSQL?
Thanks,
Stefan
© Stack Overflow or respective owner