-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `satguru_crm_satish`
--

-- --------------------------------------------------------

--
-- Structure for view `vw_account_contact`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`Satish_D`@`%` SQL SECURITY DEFINER VIEW `vw_account_contact`  AS SELECT `act`.`contact_id` AS `contact_id`, `mdov`.`option_value` AS `salutation`, concat(`act`.`first_name`,' ',`act`.`middle_name`,' ',`act`.`last_name`) AS `name`, `act`.`suffix` AS `suffix`, concat(`mu`.`first_name`,' ',`mu`.`last_name`) AS `contact_owner`, `act`.`account_id` AS `account_id`, `ma`.`account_name` AS `account_name`, concat(`rpt`.`first_name`,' ',`rpt`.`middle_name`,' ',`rpt`.`last_name`) AS `report_to`, date_format(`act`.`birthdate`,'%m/%d/%Y') AS `birthdate`, `act`.`department` AS `department`, `act`.`title` AS `title`, `act`.`fax` AS `fax`, `act`.`email` AS `email`, `act`.`phone` AS `phone`, `act`.`mobile` AS `mobile`, `act`.`nationality` AS `nationality`, `act`.`mailing_street` AS `mailing_street`, `act`.`mailing_city` AS `mailing_city`, `act`.`mailing_state_province` AS `mailing_state_province`, `act`.`mailing_zip_postal_code` AS `mailing_zip_postal_code`, `act`.`mailing_country` AS `mailing_country`, date_format(`act`.`created_on`,'%m-%d-%Y') AS `created_on`, date_format(`act`.`updated_on`,'%m-%d-%Y') AS `updated_on`, `mu`.`branch_id` AS `branch_id`, `mb`.`region` AS `region_id`, `mb`.`group_data` AS `group_id` FROM (((((`account_contacts` `act` left join `mst_dropdown_option_values` `mdov` on((`act`.`salutation` = `mdov`.`id`))) left join `mst_account` `ma` on((`ma`.`account_id` = `act`.`account_id`))) left join `account_contacts` `rpt` on((`rpt`.`contact_id` = `act`.`reports_to`))) left join `mst_user` `mu` on((`mu`.`id` = `act`.`contact_owner`))) left join `mst_branch` `mb` on((`mb`.`id` = `mu`.`branch_id`))) ORDER BY `act`.`contact_id` AS `DESCdesc` ASC  ;

--
-- VIEW `vw_account_contact`
-- Data: None
--

COMMIT;

