连接数据库

db2 connect to chmgmdb user ch_mgm

断开数据库

db2 disconnect current

查询

db2 "select * from btpoper where brhid='907020000' and oprid='0001'"
db2 "select oprid,oprnm,brhid,passwd from btpoper"

显示表前10行

select * from <表名> fetch first 10 rows only

查看当前数据库表空间分配状况

db2 list tablespaces show detail

 联表查询

left join

排序

group by

 

posted on 2018-04-24 14:39  mustafayin  阅读(139)  评论(0编辑  收藏  举报