Switch / Case Anweisung
ID | 118 |
---|---|
Link Reference | Not set |
Link Credits | Not set |
Link Technical Documentation | Not set |
PlCodelang | T-SQL |
PlGroup | Kontrollstrukturen |
PlItemTitle | Switch / Case Anweisung |
Code | -- http://msdn.microsoft.com/de-de/library/ms181765.aspx USE AdventureWorks2008R2; GO SELECT ProductNumber, Category = CASE ProductLine WHEN 'R' THEN 'Road' WHEN 'M' THEN 'Mountain' WHEN 'T' THEN 'Touring' WHEN 'S' THEN 'Other sale items' ELSE 'Not for sale' END, Name FROM Production.Product ORDER BY ProductNumber; GO |
Result Example |