1

I'm trying to convert sql oracle select to access select query. Could you explain what does this "(+)" mean? It's like join? How can I use "not in" in this case?

Select
lc.LOC, lc.HOME_ZONE, hz.AREA_TYPE, ld.QTY, sk.SKU

From
LOC lc, HOMEZONE hz, CONTAINER cn, LOAD ld, SKU sk

Where
lc.HOME_ZONE = hz.HOME_ZONE
and lc.LOC = cn.LOC (+)
and cn.CONT_NO = ld.CONT_NO (+)
and ld.PROD_NO = sk.PROD_NO (+)
and lc.LOC_COLOR_ZONE in ('80', '90', '95', '100')
and hz.AREA_TYPE in ('211', '231')
and hz.SECTION_NO not in ('990000');

1 Answer 1

3

The (+) is an Oracle shortcut for the outer join; for example the following two queries are equivalent:

SELECT *
  FROM tableA, tableB
 WHERE tableA.idA = tableB.idB(+)           

SELECT *
  FROM tableA
       LEFT OUTER JOIN tableB
         ON (tableA.idA = tableB.idB)

Your query could be rewritten in ANSI SQL like this:

SELECT lc.LOC,
       lc.HOME_ZONE,
       hz.AREA_TYPE,
       ld.QTY,
       sk.SKU
  FROM LOC lc
       INNER JOIN HOMEZONE hz USING (HOME_ZONE)
       LEFT OUTER JOIN CONTAINER cn USING (LOC)
       LEFT OUTER JOIN LOAD ld USING (CONT_NO)
       LEFT OUTER JOIN SKU sk USING (PROD_NO)
 WHERE     lc.LOC_COLOR_ZONE IN ('80', '90', '95', '100')
       AND hz.AREA_TYPE IN ('211', '231')
       AND hz.SECTION_NO NOT IN ('990000');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.