DROP TABLE IF EXISTS `v_pass`;
DROP VIEW IF EXISTS `v_pass`;

CREATE OR REPLACE VIEW `_mydb_zid_mgr_a`.`v_pass` AS 
SELECT m_pass.*, m_category.c_categoryName, m_category.c_categoryDisplayOrder,
_mydb_zid_mgr_b.m_pass2.c_val1, _mydb_zid_mgr_b.m_pass2.c_val2, _mydb_zid_mgr_b.m_pass2.c_val3, _mydb_zid_mgr_b.m_pass2.c_val4,
_mydb_zid_mgr_b.m_pass2.c_val5, _mydb_zid_mgr_b.m_pass2.c_val6, _mydb_zid_mgr_b.m_pass2.c_val7, _mydb_zid_mgr_b.m_pass2.c_val8
FROM m_pass
LEFT OUTER JOIN m_category ON m_pass.id_category = m_category.id_category
LEFT OUTER JOIN _mydb_zid_mgr_b.m_pass2 ON m_pass.id_pass = _mydb_zid_mgr_b.m_pass2.id_pass
WHERE m_pass.c_delete = 0;
