Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql cast null to string


#If you really must output every values including the NULL ones
select IFNULL(prereq,"") from test

#OR, Coalesce will return the first non-null argument passed to it
#from left to right. If all arguemnts are null, it'll return null, but we're forcing an empty string there, so no null values will be returned.
SELECT COALESCE(prereq, '') FROM test
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #cast #null #string
ADD COMMENT
Topic
Name
7+6 =