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
qanita786
Messages: 153
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
Littlefoot
Messages: 19648
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
BlackSwan
Messages: 22839
Registered: January 2009
Senior Member
http://www.orafaq.com/forum/mv/msg/180275/549936/136107/#msg_549936

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 Oct 01 06:15:54 CDT 2014

Total time taken to generate the page: 0.13790 seconds