增删改查
--增加 create INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....) --删除 delete DELETE FROM 表名称 WHERE 列名称 = 值 --删除所有行 DELETE FROM table_name drop --修改 update UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值 UPDATE Person SET FirstName = 'Fred' WHERE LastName = 'Wilson' --查询 select * from table select distinct col from table select * from table t where t.no=xxx group by t.no having order by asc desc SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value --where like like %abc% like -a% --日期函数 select to_date('2005-01-01 13:14:20','yyyy-MM-dd HH24:mm:ss') from dual; --文本函数 select to_char(sysdate,'yyyy-MM-dd HH24:mi:ss') from dual; --Null置1函数 NVL(null,1) Nvl(exp1,exp2):表达式一为null时,返回表达式二 Nvl2(exp1,exp2,exp3):表达式一为null时返回表达式三,否则返回表达式二 Nullif(exp1,exp2):两表达式相等时,返回null,否则返回表达式一 --自增序列