mysql中数据表记录的增删查改(1)
2024-10-20 08:42:37
数据记录的增删改查
insert into `数据表名称` (`字段名称`, ...) values ('1', ...);
delete from `数据表名称` where 子句;
update `数据表名称` set (`字段名称`='1', ...) where 子句;
select * from `数据表名称`;
select (`字段名称`,...) from `数据表名称`;
select `字段名称1`*`字段名称2` from `数据表名称`;
select `字段名称1` as `别名1`, `字段名称2` as `别名2` from `数据表名称`;
select distinct from `数据表名称`;
select * from `数据表名称` where `字段名称` > 1;
select * from `数据表名称` where `字段名称1` > 1 and `字段名称2` < 2;
select * from `数据表名称` where `字段名称1` > 2 or `字段名称2` > 4;
select * from `数据表名称` where not in (1, 2);
select * from `数据表名称` where in (1, 2);
select * from `数据表名称` between 1 and 3;#类似大于等于1,小于等于3
select * from `数据表名称` where `字段名称` is null;
select * from `数据表名称` where `字段名称` like '值_' or '值%' or '%值%' or '%值';#下划线表示一个字符,百分号表示任意个字符
select * from `数据表名称` order by `字段名称` asc;
select * from `数据表名称` order by `字段名称` asc;
select * from `数据表名称` order by `字段名称1` asc, `字段名称2`desc;
select * from `数据表名称` limit 0, 1;
select count(`字段名称1`), max(`字段名称2`), min(`字段名称3`), sum(`字段名称4`), avg(`字段名称5`) from `数据表名称`;
select * from `数据表名称` group by `字段名称1` order by `字段名称2` desc;#分类排序
select * from `数据表名称` group by `字段名称1` having `字段名称2`='2';
最新文章
- 三周,用长轮询实现Chat并迁移到Azure测试
- Bootstrap <;基础十二>;下拉菜单(Dropdowns)
- 使用dom4j解析XML
- linux split 命令 将一个大的文件拆分成若干小文件
- 字符串--java中判断字符串是否为数字的方法的几种方法?
- BZOJ 2152: 聪聪可可 点分治
- synchronize学习
- (五)Struts2 标签
- Bootstrap_Javascript_按钮插件
- Hough Transform直线检测
- python进阶--打包为exe文件
- sql server事物控制
- java web项目中 读取properties 路径的问题
- Java利用内存映射文件实现按行读取文件
- React-Native 系列视频失效补链及一些碎碎念
- 使用vsftp服务传输文件
- faster-RCNN框架之rpn 较小目标检测,如果只使用rpn,并减少多个候选框
- Redis持久化AOF和RDB对比
- CF86D Powerful array
- STM32f103的数电采集电路的双ADC的设计与使用
热门文章
- MySQL 开启远程链接(localhost 以外的主机)
- HTML5 Geolocation(地理定位)
- Binding a Xamarin.Forms WebView to ReactiveUI View Model using Custom Type Converters
- Win10远程连接自己的电脑提示“登陆没有成功”的解决方案
- 【0521模拟赛】小Z爱划水
- mybatis or的用法
- 20189220 余超《Linux内核原理与分析》第五周作业
- SSM框架中,ContextLoaderListener与RequestContextListener的联系与区别
- 2019软工实践_Alpha(4/6)
- Weblogic部署web项目获取项目根目录为null