随笔分类 -  Oracle

摘要:select to_char(last_day(to_date('2020-02','yyyy-mm')),'dd') from dual用 last_day 的函数 阅读全文
posted @ 2020-06-01 09:37 wc_nan 阅读(1868) 评论(0) 推荐(0)
摘要:CREATE USER etcportal IDENTIFIED BY etcportal; GRANT CONNECT,RESOURCE,EXP_FULL_DATABASE,IMP_FULL_DATABASE TO etcportal; 阅读全文
posted @ 2020-05-28 09:36 wc_nan 阅读(136) 评论(0) 推荐(0)
摘要:SELECT sys_guid(),rawtohex(sys_guid()) from dual; 阅读全文
posted @ 2020-04-02 13:37 wc_nan 阅读(1169) 评论(0) 推荐(0)
摘要:select 'drop table '||table_name||';' from cat where table_type='TABLE' 阅读全文
posted @ 2019-12-19 09:25 wc_nan 阅读(299) 评论(0) 推荐(0)
摘要:创建、删除 create sequence seq_newsId increment by 1 start with 1 maxvalue 999999999; 得到序列的SQL语句 select seq_newsid.nextval from sys.dual; 删除序列的SQL DROP SEQ 阅读全文
posted @ 2018-11-22 08:42 wc_nan 阅读(7883) 评论(0) 推荐(0)
摘要:SELECT CONCAT(CONCAT(列名,’拼接在中间的符号’),列名) FROM `sys_auth` sa ; 阅读全文
posted @ 2017-07-27 14:48 wc_nan 阅读(1632) 评论(0) 推荐(0)
摘要:Case when a=xx then ‘xx’ when a=’zz’ then ‘zz’ else ‘cc’ end as 别名相当于 if-else if-elsecase when bid.bid_stage=1 then '招标阶段' when bid.bid_stage=2 then ' 阅读全文
posted @ 2017-07-27 14:48 wc_nan 阅读(1313) 评论(0) 推荐(0)
摘要:oracle中可以使用drop、delete和truncate三个命令来删除数据库中的表, 1. delete和truncate都是删除表中的内容而不能删除表的结构,而drop则是删除表的结构和内容(表将不复存在); 2. delete可以删除整个表的数据也可以有选择性地删除某一条或多条数据,而tr 阅读全文
posted @ 2017-07-27 14:43 wc_nan 阅读(1593) 评论(0) 推荐(0)