---
title: "db2的 字典表 以及 加别名 alias"
author: "dannyhz"
date: "2017-09-15T11:15:11Z"
tags: []
categories: ["数据库"]
slug: "db2-alias"
draft: false
lastmod: "2017-09-15T11:15:11Z"
id: 2393343
url: "https://dannyhz.iteye.com/blog/2393343"
---

字典表查出差别

这里没有
select * from SYSIBM.TABLES where table_catalog = 'IBBDKUSR' AND  table_schema = 'MPOS' and table_name = 'CLEARING';

这里有
select * from SYSIBM.TABLES where table_catalog = 'IBBDKUSR' AND  table_schema = 'IBBDKUSR';


需要建别名  ， 这样 sql 语句里不需要加 ibbdkusr 前缀 就能访问到了

create alias mpos.clearing for ibbdkusr.clearing;