Outer Join Syntax

Поиск
Список
Период
Сортировка
От Richard Rowell
Тема Outer Join Syntax
Дата
Msg-id 001f01c11abe$ebd29740$8301a8c0@RICHARD
обсуждение исходный текст
Ответы Re: Outer Join Syntax
Список pgsql-sql
I'm doing a feasability study on porting our flagship product to Postgres
(from MS_SQL).  I have run across a few snags, the largest of which is the
outer join syntax.  MS has some nice syntactical sugar with the *=/=*
operators that Postgres dosen't seem to support.  I am confused on how
to replicate the behavior however. We often link together many tables via
outer joins to form a view such as:
SELECT Assessment_medical_id, a.Readonly_agency, a.Date_added, ag.name as
'AgencyName',              y1.Yesno_descrip as 'healthprob', y2.Yesno_descrip as
'MentalIllness', y3.Yesno_descrip as 'MentalTreatment',              y4.Yesno_descrip as 'drugabuse',
d1.Drug_abuse_type_descrip
as 'drug1', d2.Drug_abuse_type_descrip as 'drug2',              d3.Drug_abuse_type_descrip as 'drug3',
d4.Drug_abuse_type_descrip as 'drug4', d5.Drug_abuse_type_descrip as
'drug5'              FROM ASSESSMENT_MEDICAL a, AGENCIES ag, YESNO_TYPES02 y1,
YESNO_TYPES02 y2, YESNO_TYPES02 y3, YESNO_TYPES02 y4,              DRUG_ABUSE_TYPES d1, DRUG_ABUSE_TYPES d2,
DRUG_ABUSE_TYPES
d3, DRUG_ABUSE_TYPES d4, DRUG_ABUSE_TYPES d5              WHERE a.inactive != 'Y'              AND a.Client_id =
$Edit_Client_id             AND a.Agency_creating *= ag.Agency_id              AND a.Health_prob *= y1.Yesno_code
      AND a.EmoMental_illness *= y2.Yesno_code              AND a.Treatment_for_emomental *= y3.Yesno_code
ANDa.AlchoholDrug_abuse *= y4.Yesno_code              AND a.AlchoholDrug_abuse_type1 *= d1.Drug_abuse_type_id
  AND a.AlchoholDrug_abuse_type2 *= d2.Drug_abuse_type_id              AND a.AlchoholDrug_abuse_type3 *=
d3.Drug_abuse_type_id             AND a.AlchoholDrug_abuse_type4 *= d4.Drug_abuse_type_id              AND
a.AlchoholDrug_abuse_type5*= d5.Drug_abuse_type_id
 


I'm just not grasping how one would accomplish the same using the SQL-92
syntax.

TIA






В списке pgsql-sql по дате отправления:

Предыдущее
От: "Michael Richards"
Дата:
Сообщение: Re: Exclusion List
Следующее
От: "Joe Conway"
Дата:
Сообщение: Re: Outer Join Syntax