雷迪嘎嘎图片,百里挑一徐煜程,大剑之理想乡
id name
1 a
2 b
3 c
1 a
2 b
3 c
以下的sql语句都以上面表mytable为准:
1、查询id=1,3记录的所有数据
select * from mytable where id in(1,3)
2、删除id重复的数据,表中数据只剩下id=1,2,3的所有数据
select * into # from mytable
truncate table mytable
insert table select distinct * from #
select * from table
drop table #
3、创建一个新表 films_recent ,它的值包含来自表films
select * into films_recent from films
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
详解SQL游标的用法
类型: 1.普通游标 只有next操作 2.滚动游标 有多种操作1.普通游标declare @username varchar(20),@userid varc...
[阅读全文]
-
-
-
-
-
-
-
-
-
网友评论