关于db2常用命令总结

来源:互联网 发布:威海大叔的淘宝店 编辑:程序博客网 时间:2024/05/22 01:42

1.  list tables for schema 【模式名】

这个命令是显示该模式下的所有表和视图

 

2. 查询数据库 字段中 有没有 含有 /r/n 字段

select * from MIGDEV.TMB_FK_DBW_EXPLOITATION where JTDYWMC like '%/r/n%' or

CFDZ like '%/r/n%' or PGJG like'%/r/n%' ;

 

3. 查询差异字段中 在数据库中 , 字段最长的字段 是否大于目标系统字段

select * from MIGDEV.TMB_FK_DBW_EXPLOITATION where length(ltrim(rtrim

(QZMC))) = ( select max(length(ltrim(rtrim(QZMC))))  from

MIGDEV.TMB_FK_DBW_EXPLOITATION );