20200910随笔 SQLyog 获取数据库视图创建语句

选择视图 修改视图 获取select语句

新的数据库 重新创建视图 这是最快速有效的方法了

CREATE VIEW `数据库名`.`视图名` AS

SELECT

  `m`.`ID` AS `ID`,

  `m`.`USER_ID` AS `LOGIN_NAME`,

  CONCAT(

    `m`.`LAST_NAME`,

    `m`.`FIRST_NAME`

  ) AS `USER_NAME`,

  NULL AS `DEPARTMENT_CODE`,

  NULL AS `COMSTRU_CODE`,

  '111111' AS `PASSWORD`,

  'MDM_USER' AS `DATA_SOURCE`

FROM

  `MDM_IDM` `m`

UNION

SELECT

  `t1`.`ID` AS `ID`,

  `t1`.`LOGINNAME` AS `LOGIN_NAME`,

  `t1`.`NAME` AS `USER_NAME`,

  NULL AS `DEPARTMENT_CODE`,

  NULL AS `COMSTRU_CODE`,

  `t1`.`PASSWORD` AS `PASSWORD`,

  'SYSTEM_USER' AS `DATA_SOURCE`

FROM

  `SYSTEM_USER` `t1`

相关推荐
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客 返回首页