Conditional evaluations in SELECT clause – Section6

0
28 views
Conditional-evaluations-in-SELECT-clause

In the previous article we discuss about pre-build function in sequels or as well as how we can be able to implement them in a select statement. In this movie we’ll discuss how to use a conditional evaluation in a select statement.There are two ways how we can be able to implement conditionally volition select statement the original way how we can be able to do that was using kids when a statement will do case when an evaluation of some sort.

Then what should be the result of that evaluation should it be. And we can repeat a when and then for different conditions. Finally we can put the else statement what should happen if any of the previous conditions are not being met. In a recent version of sequencer Microsoft added this I function. I have some condition this will be a true evaluation. Or what should happen if this is true. Else what should we display.

https://cloud.google.com/bigquery/docs/reference/standard-sql/conditional_expressions

If this is wrong or false of secure this one one is greater than zero. Then this statement will be executed. Then we’ll see here a greater Also if we execute. This is the atom. I have zero craters on one. This is not true than these Vayu or a laser or be executed said use in a case where or if statement for a string or number literals like the one we did it before we can also be able to implement it in a select statement that is queering from a table or a data set.

For example we are tasked to categorize and c reate.You can create a column called economics that is based on a GDP that have greater than 300 billion to be locked and everything else to be called. Give a little peek. If we execute the sequence statement we’ll see. For Australia it has more than three hander which is four hundred seventeen billion GDP so that it’s categorized as developed here.

But if we look at Afghanistan here it only has 20 billion of GDP so that it was categorized as terrible pink. We can also be able to add additional conditions here. For example if we first categorize this one case when GDP greater than 300 to be called developed in any country that has between 200 and 300 to be called Dave or pink and everything else to be underdeveloped now free execute the select statement again we’ll see Australia being developed.

We haven’t changed any condition on that one. Afghanistan will see under a lot of our GDP is not between a hundred and 300. And you might see other countries like here that’s going to say that the lopin its annual GDP is two hundred forty three billion dollars.

https://cloudblogs.microsoft.com/sqlserver/

Share

LEAVE A REPLY

Please enter your comment!
Please enter your name here