SQL Server最基本的 增删改查

use Test
–插入
insert into MyQQTest(QqName,QqPassword) values(5,5)
–清空
delete from MyQQTest
–删除(条件)
delete from MyQQTest where QqExplain = ‘这家伙很懒,什么都没留下’
–修改某列的所有数据
update MyQQTest set QqExplain = 123
–修改多列的数据
update MyQQTest set QqExplain = 123,QqName = 321
–修改某列的所有数据(带条件)
update MyQQTest set QqExplain = ‘这家伙很懒,什么都没留下’ where QqExplain = ‘123’
–查看所有
select * from MyQQTest
–按条件查找
select * from MyQQTest where QqRegTime = ’17:25:03′
–查看某列(多列)
select QqRegDate,QqRegTime from dbo.MyQQTest
–查看某列(多列),带条件
select QqRegDate,QqRegTime from dbo.MyQQTest where QqRegTime = ’17:28:55′
SQL_Code.zip(1.4 KB, 38 次)

“SQL Server最基本的 增删改查”的6个回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注