当前位置:网站首页>SQL Server 数据库增删改查语句
SQL Server 数据库增删改查语句
2022-06-29 09:28:00 【小哥丷】
在使用SQL Server的时候,需要在新建查询中简单的处理数据库,下面介绍一下SQL基础的增删改查语句:
介绍下面用到的变量:
Table:数据库表名
Column::字段
Content:内容
1、SQL查询语句
查询全表:select * from Table
根据字段条件查询:select * from Table whereColumn = '条件'
根据同时满足多个字段条件查询:select * from Table whereColumn = '条件' andColumn = '条件' and ...
根据多个字段中的条件查询:select * from Table whereColumn = '条件' or Column = '条件' or ...
查询表中某个字段:select Column,Column,... from Table
2、SQL添加语句
insert into Table (Column,Column,...) values ('Content','Content',...)
3、SQL删除语句
根据字段中的条件删除行:delete from Table where Column = '条件'
根据多个字段中的条件删除:delete from Table where Column = '条件'' andColumn = '条件' and ...
根据同时满足多个字段中的条件删除:delete from Table where Column = '条件' orColumn = '条件' or ...
根据同个字段中不同条件删除多行:delete from Table where Column in (条件,条件,...)
4、SQL修改语句
修改全表字段内容:update Table set Column = 'Content' , Column = 'Content' , ...
根据字段条件修改该行的字段内容:
update Table set Column = 'Content' ,Column = 'Content' , ...where Column = '条件'
根据同时满足多个字段条件修改字段内容:
update Table set Column = 'Content' ,Column = 'Content' , ...where Column = '条件' and Column = '条件' and ...
根据多个字段条件修改字段内容:
update Table set Column = 'Content' ,Column = 'Content' , ...where Column = '条件' orColumn = '条件' or ...OK,这就是基础的SQL增删改查。
边栏推荐
- 函数指针、函数指针数组、计算器+转移表等归纳总结
- 二叉树
- 2020-10-17:刷题1
- Web vulnerability manual detection and analysis
- mysql 8.0 一条insert语句的具体执行流程分析(二)
- 2020-09-21 visual studio header file and Library Directory configuration
- AQS之Atomic详解
- BUUCTF--reverse2
- Add/modify/drop column of alter table operation in MySQL
- Learn spark computing framework in practice (00)
猜你喜欢
随机推荐
打印1000~2000年之间的闰年(C语言)
L1-009 sum of N numbers (20 points)
Slide the custom control to close the activity control
C#中Attribute(特性)
Ce projet Open source est super wow, des photos manuscrites sont générées en ligne
L2-025 divide and rule (25 points)
这个开源项目超哇塞,手写照片在线生成
通过Win32API调用另一界面的按钮
2019.10.27 training summary
C#中IEqualityComparer接口的实现
Excel日期及数字格式处理
View CSDN blog rankings
September 17, 2020 gateway business process has two tasks: referer certification and non commodity Templating
子串分值-超详细版——最后的编程挑战
C language library function --strstr()
CLR via C reading notes - loading and AppDomain
Picture verification code control
Comment terminer rapidement une partition de disque
2019.10.16 training summary
1-数据库了解









