Home Database Mysql Tutorial sqlserver 增删改查一些不常用的小技巧_MySQL

sqlserver 增删改查一些不常用的小技巧_MySQL

Jun 01, 2016 pm 01:05 PM
sqlserver Add, delete, modify and check

一 Insert 语句

1.在数据中只插入默认值:

insert into [DBTrain].[dbo].[log_info]
default values

2.在可以为null 的字段中,如果要设置null,可以按下[Ctrl+0],注意是零不是o,如果要恢复修改前的值按[Esc]

二 Update 语句

可以更新前几条或某个百分比的数据

update top(3) [log_info]
set info1 = '1001'

update top(80) percent [log_info]
set info2 = '1002'

三 Delete 语句同样可以使用top 关键字

四 Select 语句

1. With Ties

执行下面sql:select top 5 * from test
order by id desc

结果见下图:

再执行以下sql 看不同:

select top 5 with ties * from test
order by id desc

可以看出来当前五条记录还没有把id = 2的数据显示完整的时候,

使用with ties,就可以把id = 2 的记录都显示出来

待续. $identity, $RowGuid,Write子句

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve the problem that the object named already exists in the sqlserver database How to solve the problem that the object named already exists in the sqlserver database Apr 05, 2024 pm 09:42 PM

How to solve the problem that the object named already exists in the sqlserver database

How to import mdf file into sqlserver How to import mdf file into sqlserver Apr 08, 2024 am 11:41 AM

How to import mdf file into sqlserver

What to do if the sqlserver service cannot be started What to do if the sqlserver service cannot be started Apr 05, 2024 pm 10:00 PM

What to do if the sqlserver service cannot be started

How to check sqlserver port number How to check sqlserver port number Apr 05, 2024 pm 09:57 PM

How to check sqlserver port number

How to recover accidentally deleted database in sqlserver How to recover accidentally deleted database in sqlserver Apr 05, 2024 pm 10:39 PM

How to recover accidentally deleted database in sqlserver

Where is the sqlserver database? Where is the sqlserver database? Apr 05, 2024 pm 08:21 PM

Where is the sqlserver database?

How to solve Java connection SqlServer error How to solve Java connection SqlServer error May 01, 2023 am 09:22 AM

How to solve Java connection SqlServer error

How to delete sqlserver if the installation fails? How to delete sqlserver if the installation fails? Apr 05, 2024 pm 11:27 PM

How to delete sqlserver if the installation fails?

See all articles