Hi folks,
I have two tables, one containing detail records and one containing header records. The common columns are let's say CODE and CLIENT.
What I want to do is to select info from the detail records but join to the header record, like this:
SELECT
A.CODE, A.CLIENT, A.NAME,
B.DATE, B.AMOUNT
FROM HEADER A
INNER JOIN DETAIL B something
The pseudo-code for "something" is
FOR RECORDS WHERE A.CLIENT = B.CLIENT AND A.CODE = B.CODE
I think I can do it like this:
INNER JOIN ON A.CLIENT = B.CLIENT AND A.CODE = B.CODE
or
INNER JOIN ON A.CLIENT||A.CODE = B.CLIENT||B.CODE
Or would this do the same / be better ?
USING (CLIENT, CODE)
I don't have access to the target system, so I'm giving the local oppo instructions by email. It would be excellent if what I told him worked!
Thanks in advance!!
I have two tables, one containing detail records and one containing header records. The common columns are let's say CODE and CLIENT.
What I want to do is to select info from the detail records but join to the header record, like this:
SELECT
A.CODE, A.CLIENT, A.NAME,
B.DATE, B.AMOUNT
FROM HEADER A
INNER JOIN DETAIL B something
The pseudo-code for "something" is
FOR RECORDS WHERE A.CLIENT = B.CLIENT AND A.CODE = B.CODE
I think I can do it like this:
INNER JOIN ON A.CLIENT = B.CLIENT AND A.CODE = B.CODE
or
INNER JOIN ON A.CLIENT||A.CODE = B.CLIENT||B.CODE
Or would this do the same / be better ?
USING (CLIENT, CODE)
I don't have access to the target system, so I'm giving the local oppo instructions by email. It would be excellent if what I told him worked!
Thanks in advance!!


Comment