if...else  Using case expression for alternative representation

Chapter 14: Using Batches and Control-of-Flow Language

case expression

case expression simplifies many conditional Transact-SQL constructs. Instead of using a series of if statements, case expression allows you to use a series of conditions that return the appropriate values when the conditions are met. case expression is ANSI-SQL-compliant.

With case expression, you can:

case expression includes the keywords case, when, then, coalesce, and nullif. coalesce and nullif are an abbreviated form of case expression. For details on case expression syntax, see the Reference Manual.





Copyright © 2005. Sybase Inc. All rights reserved. Using case expression for alternative representation

View this book as PDF