conditions in the select clause?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi:

IN SQL Server you can put conditions to the fields on the SELECT clause by
using
CASE, WHEN, THEN, ELSE, END.

Is there a way to put conditions to the outputs of a field?

for example:

SELECT CASE WHEN LEN(Field1)< 3 THEN "Yes" else "No" end AS MyFieldName,
Field2, Fikeld3
From MyTable

(this is possible in SQL 2000)
 
Back
Top