Loading

随笔分类 -  SQL

摘要:set linesize 400 pagesize 999\r col machine for a20\r col sql_id for a20\r col prev_sql_id for a20\r col object_name for a20\r col object_type for a20 阅读全文
posted @ 2023-09-08 23:38 李行行 阅读(198) 评论(0) 推荐(0) 编辑
摘要:19c版本中listagg函数可以不匹配within group进行使用 with temp as( select 'China' nation ,'Guangzhou' city from dual union all select 'China' nation ,'Shanghai' city 阅读全文
posted @ 2023-03-08 11:18 李行行 阅读(71) 评论(0) 推荐(0) 编辑
摘要:1.脚本如下 snc-sdyd-oceanbase02:~/lhh # cat orac host="172.16.100.136" password=ShSnc123!@# if [ "$1" = "version" ]; then mysql -h"$host" -P2881 -uroot@sy 阅读全文
posted @ 2023-02-26 22:48 李行行 阅读(139) 评论(0) 推荐(0) 编辑
摘要:set long 1000000 SET PAGESIZE 3000 set lines 200 SET HEADING OFF SET VERIFY OFF SET FEEDBACK OFF set echo on set timing off set wrap On SET LONGCHUNKS 阅读全文
posted @ 2023-02-17 21:37 李行行 阅读(97) 评论(0) 推荐(0) 编辑
摘要:脚本 vi a.shmysql -uroot -p123456 -N >a.txt<<! select concat(concat('show create table ',TABLE_SCHEMA,'.',TABLE_NAME),'\\\G') from information_schema.ta 阅读全文
posted @ 2023-02-15 19:06 李行行 阅读(91) 评论(0) 推荐(0) 编辑
摘要:SQL> select 'select dbms_metadata.get_ddl('||chr(39)||object_type||chr(39)||','||chr(39)||object_name||chr(39)||','||chr(39)||owner||chr(39)||') from 阅读全文
posted @ 2022-11-25 16:16 李行行 阅读(51) 评论(0) 推荐(0) 编辑
摘要:spool dbtime.txt set echo off set termout off set lines 1000 set pages 1000 col con_name for a15 col tablespace_name for a25 SELECT case D.con_id when 阅读全文
posted @ 2021-09-16 10:04 李行行 阅读(71) 评论(0) 推荐(0) 编辑
摘要:SQL> set serveroutput on SQL> declare 2 cursor c_date is 3 select hire_date from employees; 4 v_date date; 5 v_day varchar2(20); 6 begin 7 open c_date 阅读全文
posted @ 2021-01-22 16:27 李行行 阅读(92) 评论(0) 推荐(0) 编辑
摘要:在变量赋值的方法中,select into只能为返回单行数据的变量进行赋值 SQL> set serveroutput on SQL> declare 2 v_date date; 3 begin 4 select hire_date into v_date from employees where 阅读全文
posted @ 2021-01-22 15:17 李行行 阅读(361) 评论(0) 推荐(0) 编辑
摘要:查看要修改的数据 SQL> select * from t1; DATE1 IDENTIFY 22-JAN-21 372928193501213223 通过update修改date1对应的日期 SQL> update t1 set date1=(select to_date(substr(ident 阅读全文
posted @ 2021-01-22 09:03 李行行 阅读(194) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up dark_mode palette
选择主题