10/28/2009

Oracle 系統 object 相關

--查出所有的objects:
select * from all_objects

--找Column名稱是ID的所有table
select * from all_tab_columns
where column_name = 'ID';

updated: Nov 12, 2009
--Oracle show Year, Month and Date
select TO_CHAR(sysdate,'Y') as YY ,TO_CHAR(sysdate,'MM') as MM,TO_CHAR(sysdate,'DD') as DD from dual

updated:Dec 17, 2009
--查詢自建Table: PT_LTDFT 有沒有欄位 DF_TYPE
SELECT COLUMN_NAME from USER_TAB_COLUMNS p WHERE p.table_name = 'PT_LTDFT' and p.column_name = 'DF_TYPE'

沒有留言:

張貼留言