Home » SQL & PL/SQL » SQL & PL/SQL » Please Make Query
Please Make Query [message #574032] Sat, 05 January 2013 13:42 Go to next message
Messages: 221
Registered: May 2007
Location: PAKISTAN
Senior Member
Dear Sir I Have Four Tables

1) Sal_master
structure is voc_no varchar2(7),voc_date date
2) sal_detail
structure is voc_no varchar2(7),item_code varchar2(10),quantity number(10,2)
3). delivery_master
structure is voc_no varchar2(7),voc_date date;
4) delivery_detail
structure is voc_no varchar2(7),item_code varchar2(10),quantity number(10,2)

Sir i want to compare these four tables i have insert 10 rows in sal_master and sal_detail tables and 5 transaction in delivery tables how to compares 10 records of sal_master,detail with delivery_master and detail if not exist in delivery_master and detail tables then display only sal_master,detail records for example

Voc_no Sale Qty Deliver Qty Remaing Qty

S000075 10 5 5 if data not found from delivery master and detail then answer must be
S000075 10 0 10

Please guide me with query examples

Thanks in Advance

Re: Please Make Query [message #574033 is a reply to message #574032] Sat, 05 January 2013 13:49 Go to previous messageGo to next message
Messages: 21130
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Have you ever heard of punctuation. Believe or not, it really exists so I'd suggest you to start using it so that people would understand what you are saying.

I suppose that properly asked question, having test case (CREATE TABLE and INSERT INTO statements) would help. Why didn't you provide these "10 rows" and "5 transaction"? Should we improvise?

Anyway: if you want to check whether something exists, try with [NOT] EXISTS or [NOT] IN.
Re: Please Make Query [message #574034 is a reply to message #574033] Sat, 05 January 2013 14:17 Go to previous message
Messages: 25537
Registered: January 2009
Location: SoCal
Senior Member

above is from a previous thread of yours!
Previous Topic: Facing issue related to single quote('), in sql query.
Next Topic: Calculating the difference of timestamps in seconds
Goto Forum:

Current Time: Wed Jul 26 05:59:46 CDT 2017

Total time taken to generate the page: 0.23261 seconds