SELECT
person.CustomerID as CustomerID,
address.Street as Street,
(
SELECT FROM Company comp
WHERE comp.Id = person.ID
AND entry_key = '_custComment' ) comp
,(SELECT FROM company comp
WHERE company.ID = person.ID
AND entry_key = '_otherInfo') other
Address addr,
Person person
WHERE person.cid = custbasicinfo.cid
AND person.cid = addr.cid
答案 0 :(得分:0)
语法上 correcter ,可能是垃圾。.
SELECT
person.CustomerID as CustomerID,
address.Street as Street,
(SELECT a FROM Company comp WHERE comp.Id = person.ID AND entry_key = '_custComment' ) comp,
(SELECT a FROM company comp WHERE company.ID = person.ID AND entry_key = '_otherInfo') other
from Address addr, Person person
WHERE person.cid = custbasicinfo.cid AND person.cid = addr.cid