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

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