当前位置:网站首页>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增删改查。
边栏推荐
- Analysis on the specific execution process of an insert statement in MySQL 8.0 (2)
- Beautiful ruins around Kiev -- a safe guide to Chernobyl!
- L1-009 sum of N numbers (20 points)
- 解决zxing的QR码包含中文时乱码的问题
- 2021 team programming ladder competition - Simulation Competition
- 《CLR via C#》读书笔记-CLR寄宿与AppDomain
- 打印100~200之间的素数(C语言)
- Reading notes of CLR via C -clr boarding and AppDomain
- 六度空间 bfs
- 2019.10.20 training summary
猜你喜欢

Win32Exception (0x80004005): 组策略阻止了这个程序。要获取详细信息,请与系统管理员联系。

QGIS mapping

区域工业互联网市场成绩单,百度智能云开物第二

函数指针、函数指针数组、计算器+转移表等归纳总结

攻防世界-Re-insfsay

520 diamond Championship 2021

Installing and configuring wmware esxi 6.5.0 in VMware Workstation

September 29, 2020 non commodity templating code level rapidjson Library

qgis制图

This open source project is super wow, and handwritten photos are generated Online
随机推荐
Recyclerview sticky (suspended) head
Weight recursion of complete binary tree -- the last programming challenge
《CLR via C#》读书笔记-单实例应用程序
Analyze in detail the PBOT mining virus family behavior and the principle of exploited vulnerabilities, and provide detailed protection suggestions for the blue army
Arc view and arc viewpager
1099 build a binary search tree (30 points)
2020-10-17:刷题1
Common usage of LINQ in C #
View CSDN blog rankings
C#中Attribute(特性)
Installing and configuring wmware esxi 6.5.0 in VMware Workstation
Seaweedfs security configuration
How can I get the stock account opening discount? Also, is it safe to open an account online?
2019.10.20 training summary
产品力不输比亚迪,吉利帝豪L雷神Hi·X首月交付1万台
全面理解Volatile关键字
520 diamond Championship 2021
在VMware workstation中安装WMware ESXi 6.5.0并进行配置
IIS server related error
Basic operations during dev use