select abs(5),abs(-5);--abs(x)函数求绝对值
select floor(1.5),floor(-2);
select rand(),rand();
select pi();
select truncate(2.1234567,3);
select round(1.2),round(1.6),round(1.123456,3);--round()返回离x最近的整数
select sqrt(16),sqrt(25);--sqrt()函数用于求平方根
select insert('mrkej',3,2,'book');
//insert(s1,x,len,s2)函数
//将字符串s1中x位置开始长度为len的字符串用字符串s2替换
select upper('mrbccd'),ucase('mrbccd');
select left('mrbccd',2);
select concat('+',rtirm(' mr '),'+');
select substring('mrbccd',3,4);
select reverse('mrbccd');
select field('mr','mrsoft','mrkj','mr');--field(s,s1,s2,...)函数返回第一个与字符串s匹配的字符串的位置
select locate('me','you love me,he love me');
select position('me' in 'you love me,he love me');
select curdate(),current_date();
select curtime(),current_time();
select now(),current_timestamp(),localtime(),sysdate();
select datediff('2011-07-05','2011-07-01');
select adddate('2011-07-05',3);
select adddate('2011-07-05',interval '1 2' year_month);
select subdate('2011-07-05',6);
select version(),connection_id();
select user(),system_user(),session_user();
select charset('aa'),collation('aa');
select password('abcd');
select md5('abcd');
select format(235.33333,3),format(1323.31333,3);--格式化函数format
select charset('abc'),charset(convert('abc' using gbk));
select now(),cast(now() as date),convert(now(),time);