MySQL Functions


concat
concatenate two columns
SELECT concat ( 'my' , 'sql' )


coalesce
return first non null column
SELECT coalesce ( col1 , col2 )


conv
convert from one base to another (hex2dec)
SELECT
conv(mid(hexcolour,1,2),16,10) as r,
conv(mid(hexcolour,3,2),16,10) as g,
conv(mid(hexcolour,5,2),16,10) as b
FROM 
hexcolours 


convert
use convert to convert character sets

select CONVERT( _utf8 'asdfasdfasdf' using latin1 )


interval
Use "interval" to create a month range
select <date> between '20070701' and '20070701' + interval 1 month - interval 1 day 


replace
replace all instances of old with new
SELECT REPLACE( col, old, new )


locate
locate string
SELECT locate( search, string, start )


substring
get substring
SELECT substring( col, start, length )



REFERRERS
MySqlDesignQuery
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki