码迷,mamicode.com
首页 > 数据库 > 详细

SQL的一切常用函数展示

时间:2016-11-17 20:37:21      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:weight   sch   length   har   current   font   c11   int   extra   

练习了一下,

用时再慢慢看吧。

SHOW WARNINGS;
SELECT quote(text_fld) FROM string_tbl;
SELECT CONCAT(danke sch, CHAR(148), n);
SELECT ASCII(ö);
SELECT LENGTH(char_fld) char_length FROM string_tbl;
SELECT POSITION(is IN vchar_fld) FROM string_tbl;
SELECT (37 * 59) / (78 - (8 * 6));
SELECT MOD(10,4);

  

SELECT POW(2,10) kilobyte, POW(2,20) megabyte,
    -> POW(2,30) gigabyte, POW(2,40) terabyte;
SELECT ROUND(72.0909, 1), ROUND(72.0909, 2), ROUND(72.0909, 3);
SELECT account_id, SIGN(avail_balance), ABS(avail_balance)
    -> FROM account;
SELECT @@global.time_zone, @@session.time_zone;
SELECT CAST(2008-09-17 15:30:00 AS DATETIME);
SELECT CAST(2008-09-17 AS DATE) date_field,
    -> CAST(108:17:57 AS TIME) time_field;
SELECT CURRENT_DATE(), CURRENT_TIME(), CURRENT_TIMESTAMP();
SELECT DATE_ADD(CURRENT_DATE(), INTERVAL 5 DAY);
SELECT LAST_DAY(2008-09-17);
SELECT DAYNAME(2008-09-18);
SELECT EXTRACT(YEAR FROM 2008-09-18 22:19:05);
SELECT DATEDIFF(2009-09-03, 2009-06-24);
SELECT CAST(1456328 AS SIGNED INTEGER);
SELECT CAST(999ABC111 AS UNSIGNED INTEGER);

 

SQL的一切常用函数展示

标签:weight   sch   length   har   current   font   c11   int   extra   

原文地址:http://www.cnblogs.com/aguncn/p/6074641.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!