1.db2 中 SQL判断物理表是否存在 SELECT * FROM SYSIBM.SYSTABLES WHERE TID <> 0 AND Name = 'TABLE_NAME' AND Creator = 'DB2INST1' ; 2.修改表名: RENAME TABLE 原表名 TO 修改后表名 ;
DB2 清除数据库序列缓存 alter sequence wfr.wfr_bill_histories_s nocache; 创建清空所有表数据脚本select 'alter table '||RTRIM(TABSCHEMA)||'.'||TABNAME||' activate not logged initially with empty table;' from syscat.tables where type = 'T' AND TABSCHEMA not in ('SYSIBM ',
.查找员工的编号.姓名.部门和出生日期,如果出生日期为空值,显示日期不详,并按部门排序输出,日期格式为yyyy-mm-dd. ),birthday,),'日期不详') birthday from employee order by dept .查找与喻自强在同一个单位的员工姓名.性别.部门和职称 select emp_no,emp_name,dept,title from employee where emp_name<>'喻自强' and dept in (select dept from
(Sorry for that click-bait heading. Couldn’t resist ;-) ) We’re on a mission. To teach you SQL. But mostly, we want to teach you how to appreciate SQL. You’ll love it! Getting SQL right or wrong shouldn’t be about that You’re-Doing-It-Wrong™ attitude
check Archiving processing 查看日志归档情况 db2 "SELECT DATE(CAST(START_TIME as TIMESTAMP)) as DATE, count(*) as NUMBER_OF_LOGS_PER_DAY, (count(*)*23.4375) as AMOUNT_LOGS_DAY_MB, DBPARTITIONNUM as DBPART FROM SYSIBMADM.DB_HISTORY WHERE operation = 'X' -- Arc