I have a table
CREATE TABLE IF NOT EXISTS `dept` ( `did` int(11) NOT NULL, `dname` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSE
try this, use COALESCE
COALESCE
.., COALESCE(dname, 'NULL'),..
making it NULL string visible. SQLFIDDLE DEMO
NULL