COALESCE() function -The COALESCE function returns the first non-NULL value from a provided list of expressions. The COALESCE function is passed an undefined number of arguments and it tests for the first nonnull expression among them.If all arguments are NULL then COALESCE returns NULL.
The syntax is as follows:
COALESCE(expression [,...n])
Suppose we have 'employee' table with some data-
we can see that there are some null in mobile column and some null in phone column, so if we need contact details of employee,it may be mobile or phone(if mobile is null then phone and if both are null then it will return null)
so In this case we have to use COALESCE function.
After executing this query, we have found this result-
this is all about COALESCE() function , now Let's discuss about ISNULL() function-
ISNULL() function-
ISNULL validates if an expression is NULL, and if so, replaces the NULL value with an alternate value. In this example, any NULL value will be replaced with a different value.
Suppose we want to mobile number of employee table, and if any value is null in mobile column then we have to return 'unknown' word in place of null as a alternative value,then we write following query -
The result set is come in this way-
Difference between ISNULL and COALESCE-
- ISNULL is limited to two arguments but in COALESCE we can use more number of arguments
- Performancewise COALESCE is faster than ISNULL
- COALESCE is ANSI SQL standard whereas ISNULL is a proprietary TSQL function
- Using select ISNULL(NULL, NULL) doesn’t throw error but select COALESCE(NULL, NULL) throw an error
Excellent blog and it’s totally loaded with valid posts on Java and .Net technology. Consider including RSS feed in your blog, so aspirants like me can follow your blog easily. .Net Training in Chennai|Dot net courses in chennai
ReplyDeleteThe knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
ReplyDeletedigital marketing training in marathahalli
digital marketing training in rajajinagar
Digital Marketing online training
full stack developer training in pune
full stack developer training in annanagar
Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
ReplyDeletepython training institute in chennai
python training in Bangalore
python training institute in chennai
This is ansuperior writing service point that doesn't always sink in within the context of the classroom. In the first superior writing service paragraph you either hook the reader's interest or lose it. Of course your teacher, who's getting paid to teach you how to write an good essay,
ReplyDeleteData science training in tambaram
Data Science training in anna nagar
Data Science training in chennai
Data science training in Bangalore
Data Science training in marathahalli
Data Science training in btm
This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
ReplyDeleteangularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
angularjs-Training in velachery
angularjs Training in bangalore
Excellent way of writing blog!
ReplyDeleteJava Training in Chennai
Python Training in Chennai
IOT Training in Chennai
Selenium Training in Chennai
Data Science Training in Chennai
FSD Training in Chennai
MEAN Stack Training in Chennai
Informative Blog, Thank you to share this
ReplyDeleteRegards,
PHP Training in Chennai | PHP Course in Chennai
Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
ReplyDeleteJava Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai
Thanks for sharing such an awesome Information with us
ReplyDeleteI Got Job in my dream company with decent 12 Lacks Per Annum salary, I have learned this world most demanding course out there in the current IT Market from the Big Data Training In Bangalore Providers who helped me a lot to achieve my dreams comes true. Really worth trying.
superb....
ReplyDeleteinplant training in chennai for it
namibia web hosting
norway web hosting
rwanda web hosting
spain hosting
turkey web hosting
venezuela hosting
vietnam shared web hosting
You have made some decent points there. I checked on the web for more info about the issue and found most individuals will go along with your views on this gadgets website.
ReplyDeleteit is an amazing blog to explore more
ReplyDeleteBEST ANGULAR JS TRAINING IN CHENNAI WITH PLACEMENT
https://www.acte.in/angular-js-training-in-chennai
https://www.acte.in/angular-js-training-in-annanagar
https://www.acte.in/angular-js-training-in-omr
https://www.acte.in/angular-js-training-in-porur
https://www.acte.in/angular-js-training-in-tambaram
https://www.acte.in/angular-js-training-in-velachery
Thanks for sharing this wonderful blog.
ReplyDeleteAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
I enjoyed by reading your blog post. Your blog gives us information that is very useful for us, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again. You can use this for any quantum realm white jacket kind of academic writing work.
ReplyDeleteDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
ReplyDeleteI appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. Best of luck
Java training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeletePython Training in Chennai
Python Training in Velachery
Python Training in Tambaram
Python Training in Porur
Python Training in Omr
Python Training in Annanagar
This comment has been removed by the author.
ReplyDeleteI feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.Software Testing Training in Chennai
ReplyDeleteSoftware Testing Training in Velachery
Software Testing Training in Tambaram
Software Testing Training in Porur
Software Testing Training in Omr
Software Testing Training in Annanagar
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
ReplyDeleteDigital Marketing Training in Chennai
Digital Marketing Training in Velachery
Digital Marketing Training in Tambaram
Digital Marketing Training in Porur
Digital Marketing Training in Omr
Digital Marketing Training in Annanagar
Extraordinary Blog. Provides necessary information.
ReplyDeletebest python institute in chennai
python training centre in chennai
MMORPG OYUNLAR
ReplyDeleteinstagram takipçi satın al
Tiktok jeton hilesi
Tiktok Jeton Hilesi
antalya saç ekimi
INSTAGRAM TAKİPÇİ
İNSTAGRAM TAKİPÇİ SATIN AL
METİN2 PVP SERVERLER
Takipçi Satın Al
perde modelleri
ReplyDeleteMOBİL ONAY
mobil ödeme bozdurma
nft nasıl alınır
Ankara Evden Eve Nakliyat
TRAFİK SİGORTASİ
Dedektor
kurma websitesi
Aşk Kitapları
Great post. keep sharing such a worthy information.
ReplyDeleteData Science Certification in Chennai
great post, keep posting. Java Training In Pune
ReplyDelete