- 博客(5)
- 收藏
- 关注
原创 jdbc_访问数据层_三层架构模板
package com.pinzhi.ClassTest.tools;import java.sql.*;import java.util.List;/**连接数据库的封装类* @author:LCH* @date Date : 2022 年* 05月04日*/public class BaseDao { public static String url = "jdbc:mysql://localhost:3306/javatest?useUnicode=true&...
2022-05-07 09:18:20
125
原创 mysql
Group by 不能用select * 语句Having 放在group by的后面.Select xx ,xx from 表名 where group by xx.xx having order by 表名 desc/asc;Count(*) count()SELECT * FROM studentinfo GROUP BY city HAVING AVG(age)>20 LIMIT 1;
2022-03-31 17:01:16
682
原创 MySQL的那些事
-- >查询出学生表中年龄为22或者24的学生信息 ,不要小括号,加小括号会报错.-- SELECT * FROM studentinfo WHERE age = (22 or 24);-- 这个也是错的-- SELECT * FROM studentinfo WHERE age = 22 or 24;SELECT * FROM studentinfo where age in 22 or age IN 24;-- >查询出学生表中地址不为上海和深圳的所有学生信息.SELECT *
2022-03-21 16:09:19
770
原创 mysql非or不等的两种表达
SELECT * FROM studentinfo WHERE city <>'上海';-- >!和=之间切勿用空格SELECT * FROM studentinfo WHERE city != '上海';
2022-03-21 15:17:03
600
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人