比较实用SQL语句总结
<p>id name <br>
1 a <br>
2 b <br>
3 c <br>
1 a <br>
2 b <br>
3 c <br><br>
以下的sql语句都以上面表mytable为准:<br><br>
1、查询id=1,3记录的所有数据 select * from mytable<br>
where id in(1,3)<br>
2、删除id重复的数据,表中数据只剩下id=1,2,3的所有数据 select * into # from mytable<br>
truncate table mytable<br><br>
insert table select distinct * from # <br>
select * from table <br>
drop table #</p>
頁:
[1]