mysql函数☣☣☠##
☠截取mid(): select mid(列,1,8) from 表名 【查看并截取,从此列的第1位开始向后查看8位,来自此表】
☠截取substr():select substr(列,2,5) from 表名 【查看并截取,从此列的第2位开始向后查看5位,来自此表】
☠截取left(): select left(列,8) from 表名 【从最左边开始截取此列的8位,来自此表】
☠截取 limit:select * from 表名 limit 0 3【查看所有来自此表的数据,截取从第1行开始向后输出第3行的那个数据】
☠拼接concat():select concat(列名1,"~",列名2) from 表名【查看并将(列名1,~,列名2 )拼接在一起,来自此表】
☠拼接group_concat():【把查询到的所有内容显示在一行】
☠拼接concat_ws(): select concat_ws(~,列名1,列名2)from 表名
【查看列名1跟列名2并将他们用~连接起来,来自此表】
报错函数☣☣☠
☠count() 计数函数
group by 分组
select count(),ordernumber from orderdetails group by ordernumber
☠rand() 可以产生0-1之间任意随机数
☠rand(0) 可以产生0-1之间固定的随机数
☠rand()2 可以产生0-2之间任意随机数
☠rand(0)2 可以产生0-2之间固定的随机数
select rand(0)2 from offices
☠floor() 向下取整
select floor(0.6)
select floor(rand(0)2) from offices 产生0-2之间有规律的0和1整数