asked on
CREATE OR REPLACE VIEW view_contact_assignedcontract AS
SELECT
-- Contact Info
ct.ContactId AS contactId,
CONCAT( ct.GivenNameEN,' ',ct.FamilyNameEN) AS contactNameEN,
CONCAT( ct.FamilyNameZH,' ',ct.GivenNameZH) AS contactNameZH,
-- Company Info
cp.CompanyId AS companyId,
cp.CompanyNameEN AS companyNameEN,
cp.CompanyNameZH AS companyNameZH,
-- Contract Info
ctr.ContractId AS contractId,
ctr.ContractName AS contractName,
ctr.ContractNumber AS contractNumber,
ctr.ContractCompleted AS contractCompleted
FROM contact ct
LEFT JOIN company cp ON ct.Company_FK = cp.CompanyId
LEFT JOIN contract ctr ON ct.AssignedContract = ctr.ContractId
MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.
TRUSTED BY
http://www.whenpenguinsattack.com/2007/04/09/10-tips-for-optimizing-mysql-queries/
http://www.databasejournal.com/features/mysql/article.php/1382791