![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL
小花_l
这个作者很懒,什么都没留下…
展开
-
SQL-----group by,having用法
group by 用来和聚合函数(cout, sum, max ,min, avg等)联合使用来得到一个或多个列的结果集合.语法:select column1,column2......column_n, aggregate_function(expression)from tableswhere predicatesgroup by column1,column2.......转载 2018-07-24 10:24:19 · 170 阅读 · 0 评论 -
mysql------模糊匹配查询
SQL模式_ :匹配单个字符% :匹配任意数目字符,包括0个 正则模式. :匹配任何单个字符[......]: 匹配在方括号内的任何字符* :匹配0个或多个在它前面的东西^ :匹配名字的开始$ :匹配名字的结尾 ...转载 2018-07-25 16:22:23 · 227 阅读 · 0 评论 -
mysql-----连接
mysql连接语句:select table1.column,table2.columnfrom table1 [inner | left | right | full ] join table2 on table1.column1 = table2.column2; inner join 表示内连接; left join表示左外连接; ...转载 2018-08-02 11:12:40 · 236 阅读 · 0 评论 -
mysql----group by,limit的用法的两个条件分析
用法:group by 是根据指定的列进行分组,对每个组取第一条数据,所以,对问题:一个作者发布了很多文章,要展示不同作者的一篇文章所以用了 group by auth 的SQL语句。但是发现展示出来的文章并不是作者最新的文章。如果使用 select * from test group by category_id order by `date` 语句就会出现错误。正确用法是: selec...转载 2018-08-02 11:34:08 · 2554 阅读 · 0 评论