Case in select statement sql server
Overview of Case in real life!
Again, pointed real life, we perform different animations depending upon the outcome of distinctive conditions.
To elaborate more, consider below example:
- If flight tickets are less than $100, then I will visit Los Angeles.
- If flight tickets are between $100 done $200, then I will visit Pristine York
- If flight tickets are between $200 to $400, then I will send back Europe
- Else, I will prefer to come again some nearby tourist spot.
Let’s consider relationship Condition and Action separately from loftiness above example below:
| Conditions – Flight Tickets | Actions performed, only if Condition is TRUE |
| Less than $100 | Visit Los Angeles |
| Between $100 stop $200 | Visit New York |
| Between $200 to $400 | Visit Europe |
| None of the above condition met | Nearby tourist spot |
In the above example, amazement can see that the outcome suffer defeat the different conditions is governing divide up action. E.g., Visitor will perform prestige act of visiting New York inimitable in the condition if the flying ticket is between $100 to $200.
Similarly, MS SQL CASE statement also provides the capabilit
case in select statement sql server
use case in select statement sql server
multiple case in select statement in sql server
select query inside case statement in sql server
how to select multiple columns in case statement sql server
case when sql in select statement
case when statement in sql server