| | |
SQL help
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
I have tried several different things with none providing the correct results. Any help is appreciated.
I have the following:
Table A Table B
Pallet_No Pallet_No
Qty Qty
I need to return:
- All of the Pallet_No's from Table A that are not in Table B
- All of the Pallet_No's from Table B that are not in Table A
- All the Pallet_No's where there is a difference in Qty b/w Table A and Table B.
Thanks for your help.
I have the following:
Table A Table B
Pallet_No Pallet_No
Qty Qty
I need to return:
- All of the Pallet_No's from Table A that are not in Table B
- All of the Pallet_No's from Table B that are not in Table A
- All the Pallet_No's where there is a difference in Qty b/w Table A and Table B.
Thanks for your help.
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
0
#3 25 Days Ago
•
•
•
•
would you mind to post here what are the different things that you have tried ?
sql Syntax (Toggle Plain Text)
SELECT e.EMPLOYEE_NAME, count(w.pallet_no) FROM pca_wms_fg w, kr_employee_v e WHERE trunc (w.modified_date) >= TO_DATE('10/18/2009','mm/dd/yyyy') AND trunc (w.modified_date) <= TO_DATE('10/21/2009','mm/dd/yyyy') AND w.MODIFIED_BY = e.BADGENUM GROUP BY e.employee_name
-----------------
sql Syntax (Toggle Plain Text)
SELECT e.EMPLOYEE_NAME, e.badgenum, count(w.pallet_no), sum(QTY) FROM pca_wms_fg w, kr_employee_v e WHERE trunc (w.modified_date) >= TO_DATE('10/18/2009','mm/dd/yyyy') AND trunc (w.modified_date) <= TO_DATE('10/23/2009','mm/dd/yyyy') AND w.MODIFIED_BY = e.BADGENUM GROUP BY e.employee_name, e.badgenum
-------------
sql Syntax (Toggle Plain Text)
SELECT employee_name, NbrPallets, CartonQty, OrderQty FROM ( SELECT employee_name, count(pallet_no) NbrPallets, sum(QTY)CartonQty, sum(qty) OrderQty FROM ( SELECT EMPLOYEE_NAME, w.pallet_no, w.QTY, 0 FROM pca_wms_fg w, kr_employee_v e WHERE trunc (w.modified_date) >= TO_DATE('10/18/2009','mm/dd/yyyy') AND trunc (w.modified_date) <= TO_DATE('10/23/2009','mm/dd/yyyy') AND w.MODIFIED_BY = e.BADGENUM GROUP BY e.employee_name UNION all SELECT employee_name, '', 0, w.qty FROM pca_wms_fg w JOIN kr_employee_v e on w.modified_by = e.badgenum WHERE w.location_to LIKE ('6%') AND trunc (w.modified_date) >= TO_DATE('10/18/2009','mm/dd/yyyy') AND trunc (w.modified_date) <= TO_DATE('10/23/2009','mm/dd/yyyy') ) GROUP BY employee_name, w.pallet_no )
------------
sql Syntax (Toggle Plain Text)
SELECT pallet_no, decode(Qty1,0,Qty2,Qty1) QTY FROM ( SELECT pallet_no, sum(QTY) Qty1, sum(LOCT_ONHAND)Qty2 FROM ( SELECT pallet_no, QTY, 0 LOCT_ONHAND FROM pca_wms_fg UNION all SELECT SUBLOT_NO pallet_no , 0, LOCT_ONHAND FROM XXPCA_INVENTORY_V@tLK ) GROUP BY pallet_no )
Thanks.
Last edited by peter_budo; 23 Days Ago at 6:13 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
![]() |
Similar Threads
- Need Microsoft SQL certified professional (Tech / IT Consultant Job Offers)
- SQL Server Developer, Manchester, UK (Software Development Job Offers)
- ASP.NET/SQL Developer/Programmer (Web Development Job Offers)
- Freelance .NET / MS SQL developer (Web Development Job Offers)
- Software Engineer (.NET , SQL) (Software Development Job Offers)
- UPS is Hiring!! PL/SQL & UNIX Technical Specialist (Software Development Job Offers)
- SQL Server DBA - " Hot " (Software Development Job Offers)
- PHP / My SQL Web developer (Web Development Job Offers)
- Sql Dba (Software Development Job Offers)
- SQL Server DBA (Software Development Job Offers)
Other Threads in the Oracle Forum
- Previous Thread: dbms
- Next Thread: what is the difference between deny and revoke?
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






