Database - Advanced SQL - Discussion
Discussion Forum : Advanced SQL - General Questions (Q.No. 4)
4.
A CASE SQL statement is which of the following?
Discussion:
6 comments Page 1 of 1.
Rakesh said:
5 years ago
In this, we can able to write both if and else conditions ;
SELECT Job,
CASE
WHEN Gender = 'M' THEN 'Male'
WHEN Gender = 'F' THEN 'Female'
ELSE 'Unknown Value'
END
FROM Employee.
SELECT Job,
CASE
WHEN Gender = 'M' THEN 'Male'
WHEN Gender = 'F' THEN 'Female'
ELSE 'Unknown Value'
END
FROM Employee.
Amulya said:
5 years ago
Please explain, if-then_else in sql with an example.
Sanjay said:
6 years ago
But we can use fun.UCase or LCase. Am I right?
Hari krishna dondapati said:
1 decade ago
It is nothing but, it will checks the equality condition like where clause in normal select statement.
If value is true, then it will display corresponding value.
If value is true, then it will display corresponding value.
AbinayaRavi said:
1 decade ago
This is like switch cases but used in if-then-else.
Kaushiki singh said:
1 decade ago
I got ucase and lcase but do not understand this case sql, how it establish if-then-else- in sql ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers