mysql 创建视图

DROP VIEW IF EXISTS VIEW_DUST_ENT;
 
CREATE VIEW VIEW_DUST_ENT AS
SELECT
CEE.*
FROM C_EI_ENTERPRISEINFO CEE
WHERE CEE.IS_ACTIVE = '1'
AND EXISTS (
SELECT
1
FROM C_EI_ENT_TAG CEET
WHERE CEET.ENTERPRISE_ID = CEE.ENTERPRISE_ID
AND CEET.TAG_ID = 'd02b171d14daa32efd82808c1c6c5f26'
);

  

posted @ 2022-03-23 16:16  甜8筒  阅读(50)  评论(0编辑  收藏  举报