DROP TABLE IF EXISTS `v_email`;
DROP VIEW IF EXISTS `v_email`;

CREATE OR REPLACE VIEW `_db_email`.`v_email` AS 
SELECT m_email.id_email, m_email.id_account, m_email.id_category, m_category.c_categoryName, m_category.c_categoryDisplayOrder,
m_email.c_name, m_email.c_host_pop3, m_email.c_port_pop3, m_email.c_username, m_email.c_password,
m_email.c_displayOrder, m_email.c_displayColor, m_email.c_delete, m_email.c_privacy
FROM m_email
LEFT OUTER JOIN m_category ON m_email.id_category = m_category.id_category
WHERE m_email.c_delete = 0;
