MySQL中特殊的SQL用法

2014-11-24 18:49:04 · 作者: · 浏览: 0

1、limit (注意行号从0开始)


limit 3,4 :第一位表示行号,第二位表示返回几行数据,这个就表示,从第4行(行号从0开始)开始返回4行数据。


limit 3 offset 4 :从行4开始取3行,其中行号从0开始


2、where col = ‘Abc’ 和where col = ‘abc’ 相同,执行匹配的时候不区分大小写,包括= , <> 等


3、字符拼接,使用函数:concat ([字符列表])


4、avg,max,min,sum 等函数忽略NULL的列。


5、insert 插入多条:


可以使用:


insert into table(col1,col2)


values(p_11,p_12),(p_21,p_22);