一 Insert 語(yǔ)句
1.在數(shù)據(jù)中只插入默認(rèn)值:
insert into [DBTrain].[dbo].[log_info]
default values
2.在可以為null 的字段中,如果要設(shè)置null,可以按下[Ctrl+0],注意是零不是o,如果要恢復(fù)修改前的值按[Esc]
二 Update 語(yǔ)句
可以更新前幾條或某個(gè)百分比的數(shù)據(jù)
update top(3) [log_info]
set info1 = '1001'
update top(80) percent [log_info]
set info2 = '1002'
三 Delete 語(yǔ)句同樣可以使用top 關(guān)鍵字
四 Select 語(yǔ)句
1. With Ties
執(zhí)行下面sql:select top 5 * from test
order by id desc
結(jié)果見下圖:
再執(zhí)行以下sql 看不同:
select top 5 with ties * from test
order by id desc
可以看出來(lái)當(dāng)前五條記錄還沒有把id = 2的數(shù)據(jù)顯示完整的時(shí)候,
使用with ties,就可以把id = 2 的記錄都顯示出來(lái)
待續(xù). $identity, $RowGuid,Write子句
新聞熱點(diǎn)
疑難解答
圖片精選