標籤:根據 body 允許 div 使用 oracle資料庫 插入 int sql
asc和desc分別表示升序和降序select * from tablename order by id desc:根據id欄位按照降序排列,從大到小select * from tablename order by id asc:根據id欄位按照升序排列,從小到大複製表DB2資料庫中複製表的方法如下複製表:create table 複製表名 like 要複製的表;插入資料insert into 複製表 select * from 要複製的表;Oracle資料庫複製表:複製整張表:create 複製表名 as select * from 要複製的表;---這裡包括資料都複製下來的只複製表,不複製資料:create 複製表名 as select * from 要複製的表 where 1=2;--這裡where就限制了不需要資料的方式。如果需要在後期添加資料,可以用下面的語句:insert into 複製表 select * from 要複製的表;---這裡不允許使用valuessql查詢語句去重方法DB2去重的方法:create table 複製一張表(做去重使用) like 原表;insert into 複製的表 select distinct * from 原表;select * from 複製表;delete from 原表;insert into 原表 select distinct * from 複製表;----------------------------db2去重方法-----方法一:----採用複製表方式可以達到去重方式,主要採用select語句中有個方法是distinct的----具體實現如下:create table 複製表 like 原表;---------------插入單條資料insert into 複製表 select distinct * from 原表 ;---------刪除中繼資料delete from 原表;-------插入新資料insert into 原表 select * from 複製表;---------------------完成-------------
表的操作(Oracle和DB2)