1.
刪除乙個表中重複的記錄,只留一條記錄。
delete from fcm_phonenum e where e.rowid > (select min(x.rowid)
from fcm_phonenum x
where x.phonenum = e.phonenum);
2.給乙個表做備份:
create table fcm_phonenum_bak as select * from fcm_phonenum;
3.合併列,使其輸出內容也合併。
select first_name || ' ' || last_name as "customer name"
from customers
4.如何查詢重覆記錄
select *
from table_name
where rowid!=(select max(rowid)
from table_name d
where table_name.col1=d.col1
and table_name.col2=d.col2)
5.如何修改表名
alter table old_table_name rename to new_table_name;
6.獲得全年日期
select to_char(to_date('20120101', 'yyyymmdd')+rownum-1, 'yyyy-mm-dd') as year_date
from all_objects
where rownum <= to_char(to_date('20121231', 'yyyymmdd'), 'ddd')
7.修改字段資訊
alter table table_name modify (field_name varchar2(100));
8.字串的連線
(1)select concat(col1,col2) from table_name;(2) select col1 || col2 from table_name;
工作中一些工具的使用!
工作中經常會用到壓縮跟替換命令,用到的時候網上查一下,用完也就忘了。對於工具我的態度是 會用就好。但經常的查詢搜尋搞的我也很煩,還是做個筆記吧,自己做的也是最適合自己的,等以後什麼也記不住了,至少還有存世的東西。嘻嘻 將當前目錄下所有檔案壓縮成rootfs.tar.bz2 tar tar jcvf ...
YYHD 工作中一些總結 5
git checkout b dev 這個git checkout命令加上 b引數表示建立並切換 git branch a 檢視遠端分支 git branch 檢視本地分支 git branch test 建立分支 git checkout test 切換分支到test git branch d x...
gcc 中一些有用的選項
gcc print libgcc file name print current library search paths and their order ld verbose grep search show all files succeessfully opened during linkin...