一、 日期相关函数
select current_date();
select current_date;
select current_time;
当前时间戳:select current_timestamp;
select date_add (current_timestamp(), interval 1 year);
select date_add (current_timestamp(), interval 1 month);
select date_sub (current_timestamp(), interval 1 year);
select date_sub (current_timestamp(), interval 1 month);
select datediff(current_timestamp(), date_add (current_timestamp(), interval 1 month );
select timediff('12:30:30', '18:30:30');
select now();
select year(now());
select month(now());
二、流程控制函数
IF (expr1,expr2,expr3);
select if (1 > 0, 'hello','see you');
IFNULL (expr1,expr2);
select ifnull (null, 3 + 2);
SELECT CASE WHEN expr1 then expr2 else expr3 end;
select case when 10> 0;
三、其他函数
USER();
DATABASE();
MD5(str) ;
PASSWORD(str );