SQL Case statement

CASE Column1
  WHEN 1 THEN Column2*1
  WHEN 2 THEN Column2*2
  ELSE Column2
END as MyColumn,
-- or
CASE 
  WHEN max(Column1) = 1 THEN Column2*1
  WHEN max(Column1) = 2 THEN Column2*2
  ELSE Column2
END as MyColumn,

Comments

Popular posts from this blog

Parse XML to dynamic object in C#

C# Updating GUI from different thread