What is the SQL CASE Statement? Provide an example and explanation. The CASE Statement (more commonly known as the CASE Expression) allows you execute parts of a SQL statement conditionally. So, for example, you can use the CASE statement to format the results of the query conditionally – based on the values in another column. Two general forms of the CASE expression Note that there are actually two general forms of the CASE expression. We’ll go over one of them here and provide a link to the other one below. SQL CASE Syntax Here is the syntax for the simpler form of the CASE expression:
Read full article from SQL CASE Statement
No comments:
Post a Comment