Knowledge Walls
John Peter
Pune, Maharashtra, India
COALESCE() method in Mysql with Example in Methods of MySQL
7831 Views
COALESCE() 
COALESCE() Method taking list of values.

Returns not null value at first occurance of the list, otherwise null when all list values are null.
Example
-- returns one
SELECT COALESCE("one","two","three");

-- returns two
SELECT COALESCE(null,"two","three");

-- returns one
SELECT COALESCE("one",null,"three");

-- returns three
SELECT COALESCE(null,null,"three");

-- returns null
SELECT COALESCE(null,null,null);
Output 
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details