南昌建设企业网站公司,游戏源码,赣州章贡区二手房出售信息,seo和sem分别是什么在看script的时候#xff0c;经常会发现一些看不懂的地方。搜索了一下#xff0c;发现sql还有很多的函数#xff0c;这是以前不了解的。在这里做一个练习跟总结--------|length()返回字符串的长度select length(alliance_id) from application;--------|substr(string,st… 在看script的时候经常会发现一些看不懂的地方。搜索了一下发现sql还有很多的函数这是以前不了解的。在这里做一个练习跟总结--------|length() 返回字符串的长度 select length(alliance_id) from application;--------|substr(string,start,count)取子字符串从start开始取出count个字符 select substr(application_receipt_date,2,3)from application;-------|replace(string,s1,s2)string 希望被替换掉的字符或者变量s1:被替换的字符s2:要替换的字符 select replace(application_receipt_date,JUN,otc)from application;--------|add_months()增加或者删减月份-------|last_day返回日期的最后一天-------|months_between(date2,date1)返回date2-date1之间的月份-------|to_char , TO_MULTI_BYTE , TO_NUMBERselect to_char(application_receipt_date,mm.dd)from application;------|sysdate返回系统时间 ------|LEAST , min() ,max()返回一组表达式中最 大/小 的值-------|UID返回当前用户的唯一整数------|AVG(distinct|all)all 对于所有的值求平均值distinct 只对不同的值求平均值------|group by 主要对于一组数做统计select application_id,count(*) from application group by application_id;表示从这个表中选取application 并且统计出现的总数。------|having对于分组统计再加上限制条件类似where------|order by.... desc对于查询结果进行排序。desc属于降序排序更多函数可参考 http://www.cnblogs.com/zhangronghua/archive/2007/08/20/862812.html 转载于:https://blog.51cto.com/ehealth/1718733