String Comparison Issue

Above statement might not return the result as you expect because records will be excluded if its value is null. So here is the perfect solution:

Reference: http://stackoverflow.com/questions/16324504/mysql-how-to-perform-string-does-not-equal