![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql
sitelist
这个作者很懒,什么都没留下…
展开
-
mysql--php导出mysql为csv并添加BOM
<?php/* * PHP code to export MySQL data to CSV * * Sends the result of a MySQL query as a CSV file for download * Easy to convert to UTF-8. */ /* * establish database connection */$link = mysqli_connect("localhost", "my_user", "my_password".原创 2021-09-06 14:23:07 · 184 阅读 · 0 评论 -
mysql----查询各个年龄段人数
selectnndas'年龄段',sum(人数)as'年龄段人数'from(selectcasewhen年龄>21and年龄<=25then'21-25'when年龄>26and年龄<=30then'26-30'when年龄>31and年龄<=35then'31-35'when年龄>36and年龄<=40then'36-40'else'other'endasnnd,人数from...原创 2021-09-05 17:04:06 · 7208 阅读 · 0 评论 -
mysql----分组统计每个组的记录数
SELECT count(*),`订书编号` FROM `TABLE 20` GROUP BY `订书编号`教师节学校给老师订书,每个人一本。一共有51种书,学校想统计一个订书编号位N的书共订了几本?一个小栗子:张三 2李四 3王五 3赵六 1杨七 4周八 1白九 1结果是:count(*)`订书编号` 3 ...原创 2021-09-04 14:14:38 · 702 阅读 · 0 评论