Subject | sql problem |
---|---|
Author | frische_brise2003 |
Post date | 2003-11-05T11:07:06Z |
Hi all,
I'm using firebird 1.5 rc6 and get unexpected results
when I execute a query.
My query:
SELECT
CONTACT.PK,
CONTACT_SALUTATION.NAME,
X.NAME AS XX
FROM
CONTACT
LEFT OUTER JOIN CONTACT_SALUTATION ON (CONTACT.FK_1 =
CONTACT_SALUTATION.PK)
LEFT OUTER JOIN CONTACT_SALUTATION X ON (CONTACT.FK_FK2 = X.PK)
Result:
PK |NAME |XX
---------------------------
1 | n1| n3
2 | n1| n3
3 | n1| n3
4 | n1| n3
PK
Problem: in the original table (CONTACT) the values of
FK_SALUTE_ADDRESS resp. FK_SALUTE_EMAIL are not the same for
the records with PK = 1, 2, 3 and 4. It looks like this:
CONTACT
PK | FK1 | FK2
-------------------------
1 | 5| 4
2 | 8| 6
3 | 9| 7
4 | 1| 5
What am I doing wrong? _ Is the syntax of my query incorrect?
I'm using firebird 1.5 rc6 and get unexpected results
when I execute a query.
My query:
SELECT
CONTACT.PK,
CONTACT_SALUTATION.NAME,
X.NAME AS XX
FROM
CONTACT
LEFT OUTER JOIN CONTACT_SALUTATION ON (CONTACT.FK_1 =
CONTACT_SALUTATION.PK)
LEFT OUTER JOIN CONTACT_SALUTATION X ON (CONTACT.FK_FK2 = X.PK)
Result:
PK |NAME |XX
---------------------------
1 | n1| n3
2 | n1| n3
3 | n1| n3
4 | n1| n3
PK
Problem: in the original table (CONTACT) the values of
FK_SALUTE_ADDRESS resp. FK_SALUTE_EMAIL are not the same for
the records with PK = 1, 2, 3 and 4. It looks like this:
CONTACT
PK | FK1 | FK2
-------------------------
1 | 5| 4
2 | 8| 6
3 | 9| 7
4 | 1| 5
What am I doing wrong? _ Is the syntax of my query incorrect?