Need help with SQL query

May 21, 2009 at 06:45:27
Specs: Windows XP
I have the following query:

SELECT "AB_JOB"."AB_JOB_NUM",
"SHEET_SKID"."SHEET_SKID_NUM",
"SHEET_SKID"."SHEET_NET_WT",
"SHEET_SKID"."SHEET_TARE_WT",
"SHEET_SKID"."SKID_DATE",
"SHEET_SKID"."SKID_PIECES",
"PRODUCTION_SHEET_ITEM"."COIL_ABC_NUM",
"SHEET_SKID"."SKID_SHEET_STATUS",
"SHEET_PACKING_ITEM"."PACKING_LIST"
FROM "AB_JOB",
"CUSTOMER_ORDER",
"SHEET_SKID",
"PRODUCTION_SHEET_ITEM",
"SHEET_SKID_DETAIL",
"SHEET_PACKING_ITEM"
WHERE ( "AB_JOB"."ORDER_ABC_NUM" = "CUSTOMER_ORDER"."ORDER_ABC_NUM" ) and
( "SHEET_SKID"."AB_JOB_NUM" = "AB_JOB"."AB_JOB_NUM" ) and
( "SHEET_SKID_DETAIL"."PROD_ITEM_NUM"="PRODUCTION_SHEET_ITEM"."PROD_ITEM_NUM" ) and
( "SHEET_SKID"."SHEET_SKID_NUM" = "SHEET_SKID_DETAIL"."SHEET_SKID_NUM" ) AND
( "SHEET_SKID"."SHEET_SKID_NUM" ="SHEET_PACKING_ITEM"."SHEET_SKID_NUM")
( ( "CUSTOMER_ORDER"."ORIG_CUSTOMER_PO" = '68501454' ))

I need to modify this to report all items even if
"SHEET_SKID"."SHEET_SKID_NUM" is NULL

Can anyone help me out?


See More: Need help with SQL query

Report •


#1
May 22, 2009 at 06:42:21
Not being familiar with your SQL environment or your data, my guess is you need to do an outer join:

FROM "AB_JOB",
"CUSTOMER_ORDER",
"OUTER SHEET_SKID",
"PRODUCTION_SHEET_ITEM",
"SHEET_SKID_DETAIL",
"SHEET_PACKING_ITEM"

Then again, it might be LEFT OUTER:

"LEFT OUTER SKEET_SKID"

I've used Informix, SQL Server, and Teradata and I've never heard of surrounding the objects with double quotes.


Report •
Related Solutions


Ask Question