Select coalesce(sal ,2)+100 as sal from tablename. What is the meaning of above query | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Select coalesce(sal ,2)+100 as sal from tablename. What is the meaning of above query

5th May 2017, 2:08 PM
mahesh mahi
mahesh mahi - avatar
2 Answers
+ 3
coalesce check if sal is null. If It's null, the value 2 is evaluated. Then the result is 102 if sal isn't null is added to 100
5th May 2017, 2:17 PM
⏩▶Clau◀⏪
⏩▶Clau◀⏪ - avatar
+ 2
Furthermore 'sal' probably means salary 😁
5th May 2017, 2:21 PM
⏩▶Clau◀⏪
⏩▶Clau◀⏪ - avatar