java類:
public static void main(String[] a){}
Map、properties-->key, value
List、Linked-->順序
Set-->不重覆
Sorted、Tree-->排序
Hash-->雜物
oracle類:
INSERT INTO <table>(<many field>)VALUES(<many value>); INSERT INTO <table> VALUES(<many value>); INSERT INTO <table1> (<many field>) SELECT many field FROM <table2> WHERE...; DELETE FROM <table>; UPDATE <table_name> SET <column> = <value> WHERE...; SELECT * FROM <table>;
CREATE TABLE <table> ( <field> <type> [not null], CONSTRAINT <pk_name> PRIMARY KEY(<field>), CONSTRAINT <fk_name> FOREIGN KEY (<field>) REFERENCES <table>(<field>) [ON DELETE CASCADE] ); CREATE SEQUENCE XXX_SEQUENCE INCREMENT BY 1 -- 每次加幾個 START WITH 1 -- 從1開始計數 NOMAXVALUE -- 不設置最大值 NOCYCLE -- 一直累加,不循環 CACHE 10;
XXX_SEQUENCE.NEXTVAL XXX_SEQUENCE.CURRVAL COMMENT ON TABLE <table> IS 'xxx'; COMMENT ON COLUMN <table>.<field> IS 'ooo';
ALTER TABLE <table> ADD <field> <type>; ALTER TABLE <table> DROP COLUMN <field>; ALTER TABLE <table> MODIFY <field> <type> [not null];--修改欄位,不包括重命名 ALTER TABLE <table> RENAME COLUMN <old_field> TO <new_field>;--重命名用這個 --看版本 SELECT * FROM V$VERSION; --看所有表的comment SYS.USER_TAB_COMMENTS --看所有欄的comment SYS.USER_COL_COMMENTS
--看所有表 SYS.USER_TABLES; --某個表的某個欄包括ABC,只要知道有一張全表查詢的表叫USER_TAB_COLUMNS就夠了 SELECT * FROM SYS.USER_TAB_COLUMNS WHERE TABLE_NAME = '<table>' AND REGEXP_LIKE (COLUMN_NAME, '*ABC*');
沒有留言:
張貼留言