实训day2
来源:互联网 发布:mac解压缩软件zip 编辑:程序博客网 时间:2024/06/16 01:51
Mysql语句
like 不加上“%”或者“_”就等于“等于”
like '%a' 查询以a结尾的LIKE '_a%'查询第二个字符是a的 (以此类推)
自定义一个转义字符是escape
select * from user where userID not in(4,5,8) ORDER BY userID desc 按ID倒序排序
select * from user where userID not in(4,5,8) ORDER BY userID asc 按ID正序排序
select * from user where userID not in(4,5,8) ORDER BY sex desc ,flag asc 先满足第一个条件在满足第二个条件
select password from user where userID<5 查找ID小于5的用户密码
select * from user where password like '%8%' 查找数据库中密码中间含有数字8的密码
update user set password='11111' where userID=5 修改数据库中ID为5的用户密码为111111
select * from user where password like '_8%' 选出数据库中密码第二位为8的用户
insert into user(username,password,sex,flag) values('qweqweqwe','222','1','1') 添加用户qweqweqwe,密码为222,男性,flag为1的数据
select * from user where password like '%7_' 查找数据库中用户密码倒数第二位为数字7的用户
insert into user(username,password,sex,flag) values('username','%312','1','3') 添加用户名为username,密码为%312,男性,flag为3的数据
select * from user where password like '%\%%' 查找数据库中用户密码中间含有%号的用户
select * from user where password like '\%%'
select * from user where userID not in(4,5,8) ORDER BY sex desc ,flag asc
select * from user where userID not in(4,5,8) ORDER BY userID desc
select * from user where userID not in(4,5,8) ORDER BY userID asc
select * from user where password not like '\%%'
delete from user where userID=2 删除用户ID 为2的数据
select * from user where password like '\%%' or '%\%%'
select * from user where userID =4 or userID=5 or userID=7
select * from user where userID in (4,5,7)
select * from user where userID not in (4,5,7)
delete from user where userID=7
insert into user (username,password,sex,flag) values('sdfs','qwe11','0','1')
阅读全文
1 0
- 实训day2
- Day2
- day2
- DAY2
- day2
- DAY2
- day2
- day2
- day2
- day2
- day2
- day2
- day2
- day2:
- day2
- Day2
- Day2
- Day2
- css实现螺旋向上动画
- 欢迎使用CSDN-markdown编辑器
- Fullscreen API的简单使用方法
- HDU6113 度度熊的01世界(深搜DFS,2017"百度之星"程序设计大赛
- 执行环境和作用域
- 实训day2
- 用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。
- POJ 2240 Floyd的变式
- 大数据预科班6
- kotlin学习day7:null安全
- tomcat 源码学习——准备工作
- qt5 槽的使用的简单例子(connect函数)
- Codeforces 486E. LIS of Sequence
- 微信小程序语音识别探索