Home » SQL & PL/SQL » SQL & PL/SQL » Compare Two Tables and generate the differences in the third (merged 3 + really old one)
icon5.gif   Compare Two Tables and generate the differences in the third (merged 3 + really old one) [message #350174] Wed, 24 September 2008 05:15 Go to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
hi all;

i have two tables, the first one contains the destinations, the destination codes and the price/minute, the second table contains the dialed number and the call duration in minutes, what i need is to generate a table that contains the destination, the total minutes and the Price/Minute depending on the comparison between the destination code in the first table and the called number in the second table, the problem is that some destination codes may contain up to 7 digits (between 1 and 7 digits)

the tables look like this:

the 1st Table: Prices table
Destination             Code    Price
---------------------------------------------  
Afghanistan-Mobile	9370	0.1691
Afghanistan-Mobile	9377	0.1691
Afghanistan-Other	93	0.2005
Albania-AMC Mobile	35568	0.1799
Albania-Other	        355	0.039
Albania-Tirana	        3554	0.024
Albania-Vodafone Mobile	35569	0.1856
Algeria-Algiers	        21320	0.124
Algeria-Algiers	        21321	0.124
Algeria-MPTA Mobile	2136	0.121
Algeria-MPTA Mobile	21398	0.121
Algeria-MPTA Mobile	21399	0.121
Algeria-Orascom Mobile	2137	0.124
Algeria-Orascom Mobile	21390	0.124
Algeria-Orascom Mobile	21391	0.124
Algeria-Orascom Mobile	21392	0.124
Algeria-Orascom Mobile	21393	0.124
Algeria-Orascom Mobile	21394	0.124
Algeria-Orascom Mobile	21395	0.124
Algeria-Other	        213	0.122
Algeria-Wataniya Mobile	2135	0.092
American Samoa-Mobile	16842	0.0411
American Samoa-Mobile	168473	0.0411
American Samoa-Other	1684	0.0565
Andorra-Mobile	        3763	0.2362
Andorra-Mobile	        3764	0.2362
Andorra-Mobile	        3766	0.2362
Andorra-Other	        376	0.018
Angola-Mobile	        24491	0.1302
Angola-Other	        244	0.0995
Angola-Unitel Mobile	24492	0.1285
Anguilla-Digicel Mobile	1264581	0.1341
Anguilla-Digicel Mobile	1264582	0.1341
Anguilla-Digicel Mobile	1264583	0.1341
Anguilla-Digicel Mobile	1264584	0.1341
Anguilla-Mobile	        1264235	0.1635
Anguilla-Mobile	        1264469	0.1635
Anguilla-Mobile	        1264476	0.1635
Antarctica-All Country	6721	0.2811
Antigua & Barbuda-Other	1268	0.0775
Argentina-Buenos Aires	5411	0.0053
Argentina-Central	54230	0.0073
Argentina-Central	54232	0.0073
Argentina-Cordoba	54351	0.0133
Argentina-La Plata	54221	0.0064
Argentina-Mar Del Plata	54223	0.006
Argentina-Mendoza	54261	0.006
Argentina-Mobile	549	0.0302
Argentina-Rosario	54341	0.006
Armenia-Karabakh	37447	0.2142
Armenia-Karabakh Mobile	37497	0.2173
Armenia-Mobile	        37491	0.1336
Armenia-Mobile	        37492	0.1336
Armenia-Mobile	        37493	0.1336
Aruba-Digicel Mobile	29773	0.1045
Aruba-Digicel Mobile	29774	0.1045
Aruba-Mobile	        29756	0.1242
Aruba-Mobile	        29759	0.1242
Aruba-Mobile	        29796	0.1242
Aruba-Mobile	        29799	0.1242
Australia-Mobile	614	0.0745
Australia-Mobile	6114	0.0745
Australia-Mobile	6116	0.0745


the 2nd Table: Phone calls and Total Minutes
Called Number	Minutes
-----------------------------
96170690185	14.5333
96170690185	0.3
96170690185	2.35
96170690185	2.65
96170690185	1.1333
96170690185	0.5333
96170690185	0.7833
96170690185	1.05
96170690185	1.5833
96170690185	0.2833
96170690185	0.3167
962796809833	26.8667
96170690185	1
239280818	5.0167
16025413427	0.5333
14164906481	0.5167
16025413427	14.8167
963956656990	3.7333
989360061987	0.1
962799552910	7.7667
13146621940	0.1333
989360606196	0.0667
38535266477	0.6667
971502427263	1.2333
971507470480	1.3




what i need is the following table:

Called Number	destination	       Minutes	 charge
--------------------------------------------------------
9362247167	Afghanistan-Other	0.2	0.2005
9366823779	Afghanistan-Other	0.8167	0.2005
93932215496	Afghanistan-Other	0.75	0.2005
548009993511	Argentina-Other	        0.2167	0.0234
548009993511	Argentina-Other	        0.2167	0.0234
548009993511	Argentina-Other	        0.2167	0.0234
548009993511	Argentina-Other	        0.3167	0.0234
61883345583	Australia-Metro Cities	0.0167	0.0103
61883345583	Australia-Metro Cities	0.1833	0.0103
61892563416	Australia-Metro Cities	2.95	0.0103
61404204176	Australia-Other	        0.9833	0.0111
61287202857	Australia-Other	        0.4667	0.0111
61412743500	Australia-Other	        0.0167	0.0111



i know this is complicated but i hope someone can help me here,
please find attached a sample of what i want
  • Attachment: Sample2.pdf
    (Size: 48.25KB, Downloaded 539 times)
Re: Compare two tables and get a new table [message #350178 is a reply to message #350174] Wed, 24 September 2008 05:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Post a test case: create table and insert statements along with the result you want with these data.


Regards
Michel
Re: Compare two tables and get a new table [message #350185 is a reply to message #350174] Wed, 24 September 2008 05:33 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
You may join the two tables on a condition using like operator.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm#i1034153

Bye Alessandro
Re: Compare two tables and get a new table [message #350187 is a reply to message #350178] Wed, 24 September 2008 05:38 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
i already have the tables I am just looking for the third table as i mentioned before, if you want to know the data types here they are:
for the first table - the Prices Table:

Destination= varchar2(500)
Code= number
Price= float

for the second Table - Phone calls and Total Minutes:

Called Number= number
Minutes= float

hope this will help, the result i need is in the third table and u can also find it in the attached file


Re: Compare two tables and get a new table [message #350191 is a reply to message #350187] Wed, 24 September 2008 05:50 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Wed, 24 September 2008 12:18

Post a test case: create table and insert statements along with the result you want with these data.


Regards
Michel


Re: Compare two tables and get a new table [message #350193 is a reply to message #350174] Wed, 24 September 2008 05:52 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

But Like Operator May not give the desired output in this case.

Because ...

Afghanistan-Mobile	9370	0.1691
Afghanistan-Mobile	9377	0.1691
Afghanistan-Other	93	0.2005


If the called Number is something like 93727875676465 or 934567867689 the Actual destination will be Afghanistan-Other. Like Operator has all the chance to fail here.


The workaround (SQL) will be ..

1. For each called number , generate 7 possible destination Numbers ( like 9372787, 937278, 93727, 9372, 937, 93, 9 in case of 93727875676465 ).

2, Join genarated numbers with First table .

3. And get the destination with largest fraction ( 1- 7)



Btw, Test case means , Crate Table and insert table script to generate the issue case , so that respondent has no need to think much to reproduce the data. It is for our convenience.


Thumbs Up
Rajuvan.
Re: Compare two tables and get a new table [message #350232 is a reply to message #350193] Wed, 24 September 2008 08:11 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
There is always the chance to add some more conditions.

something with a not exists for a compatible prefix like current_prefix||'%' and current_prefix <> prefix.

Bye Alessandro

[Updated on: Wed, 24 September 2008 08:11]

Report message to a moderator

Re: Compare two tables and get a new table [message #350235 is a reply to message #350232] Wed, 24 September 2008 08:21 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
In this way I used analytics to avoid anti-self-join.

select Called_Number, destination, Minutes, charge
from (
		select Called_Number, destination, Minutes, price*minutes as charge,
			row_number() over (partition by called_number order by prefix desc) as rn
		from Phone_calls
			join Prices_table on (called_number like code||'%')
		)
where rn = 1
/


Bye Alessandro
Re: Compare two tables and get a new table [message #350262 is a reply to message #350174] Wed, 24 September 2008 09:13 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
How is it that you are linking the called numbers with the destinations?
Re: Compare two tables and get a new table [message #350355 is a reply to message #350174] Wed, 24 September 2008 16:51 Go to previous messageGo to next message
zoltanp
Messages: 58
Registered: March 2005
Location: Hungary
Member
Something like this:

select * from phone_calls,prices
 where phone_calls.called_number like prices.code||'%'
 and length(prices.code)=(select max(length(prices2.code)) from prices prices2 where phone_calls.called_number like prices2.code||'%');


regards,
Zoltán Patalenszki

[Updated on: Wed, 24 September 2008 16:52]

Report message to a moderator

Re: Compare two tables and get a new table [message #350391 is a reply to message #350174] Wed, 24 September 2008 22:36 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Solution using Row generator technique is

SELECT Called_Number,
       Minutes, 
       Destination,
       Code,
       Price 
       FROM (
select CT.*,
       PT.*,
       RANK() OVER (PARTITION BY CALLED_NUMBER,MINUTES   ORDER BY  XT.l DESC ) RNk
        from call_time CT,
             ( select level l from dual connect by level <8) XT ,
             PRICE_TAB PT
        WHERE SUBSTR(CT.CALLED_NUMBER,1,l) =  PT.Code)
WHERE RNK=1


Thumbs Up
Rajuvan.

[Updated on: Wed, 24 September 2008 22:39]

Report message to a moderator

Re: Compare two tables and get a new table [message #350394 is a reply to message #350174] Wed, 24 September 2008 22:55 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

@raed_237,

All of these queries will ( including Mine Embarassed ) , if there is another primary key , candidate key in the call_time Table where calls are made to destination number with same duration .Like ..


96170690185	1.1333
96170690185	1.1333


I hope , the Code given by you is a pseudocode.

Thumbs Up
Rajuvan.
Re: Compare two tables and get a new table [message #350477 is a reply to message #350394] Thu, 25 September 2008 03:26 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
rajavu1 wrote on Thu, 25 September 2008 05:55
@raed_237,
if there is another primary key , candidate key in the call_time Table where calls are made to destination number with same duration


Probably you misunderstood the proposed solutions.

Once we have a call with a dialed number and its duration, we need to find the longer area code ( so the last in alphabetical order ) that suites as prefix for the dialed number, then multiply the cost per minute for the call duration to get the call cost.

Bye Alessandro
Re: Compare two tables and get a new table [message #350482 is a reply to message #350174] Thu, 25 September 2008 03:36 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

NO Misunderstanding ..

OP Doesn't want to get the total cost of call but only the Price Per Minute.

Quote:
what i need is to generate a table that contains the destination, the total minutes and the Price/Minute depending on the comparison between the destination code in the first table and the called number in the second table



You can also see the example for the same in the PDF by the OP. There also he is not calculating the total cost of call.

Thumbs Up
Rajuvan.

[Updated on: Thu, 25 September 2008 03:40]

Report message to a moderator

Re: Compare two tables and get a new table [message #350485 is a reply to message #350235] Thu, 25 September 2008 03:40 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
thanks Alesandro

but it gave an error with the (by prefix desc)
i don't know why, it says Prefix: invalid identifier

Alessandro Rossi wrote on Wed, 24 September 2008 16:21
In this way I used analytics to avoid anti-self-join.

select Called_Number, destination, Minutes, charge
from (
		select Called_Number, destination, Minutes, price*minutes as charge,
			row_number() over (partition by called_number order by prefix desc) as rn
		from Phone_calls
			join Prices_table on (called_number like code||'%')
		)
where rn = 1
/


Bye Alessandro

Re: Compare two tables and get a new table [message #350486 is a reply to message #350232] Thu, 25 September 2008 03:40 Go to previous messageGo to next message
ctr8130
Messages: 2
Registered: January 2008
Junior Member
There should be relation between the two tables that you are using.
Primary key and foreign key concept is missing .Pls let us know the primary key and foreign key of the first two tables that has been used.

Regards
Rajesh
Re: Compare two tables and get a new table [message #350487 is a reply to message #350482] Thu, 25 September 2008 03:42 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
Actually it is not a big deal, i can calculate the total later

rajavu1 wrote on Thu, 25 September 2008 11:36
NO Misunderstanding ..

OP Doesn't want to get the total cost of call but only the Price Per Minute.

Quote:
what i need is to generate a table that contains the destination, the total minutes and the Price/Minute depending on the comparison between the destination code in the first table and the called number in the second table



You can also see the example for the same in the PDF by the OP. There also he is not calculating the total cost of call.

Thumbs Up
Rajuvan.



Re: Compare two tables and get a new table [message #350488 is a reply to message #350482] Thu, 25 September 2008 03:44 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
The column with the different name driven me to the other direction. But the same technique can be used for it with no problems.

I just didn't understand the problem you're talking about regarding the primary key and the candidate key you were talking about.

Bye Alessandro
Re: Compare two tables and get a new table [message #350489 is a reply to message #350486] Thu, 25 September 2008 03:44 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
the relation is by using the Code in the Prices table and the Called_number table

ctr8130 wrote on Thu, 25 September 2008 11:40
There should be relation between the two tables that you are using.
Primary key and foreign key concept is missing .Pls let us know the primary key and foreign key of the first two tables that has been used.

Regards
Rajesh

Re: Compare two tables and get a new table [message #350490 is a reply to message #350174] Thu, 25 September 2008 03:47 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Yes.. But calculating the same as in Real scenario ( with slabs , rounding etc) is not a small deal also . Smile

Thumbs Up
Rajuvan.
Re: Compare two tables and get a new table [message #350493 is a reply to message #350355] Thu, 25 September 2008 03:49 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
thanks a lot ... working like a charm Smile

zoltanp wrote on Thu, 25 September 2008 00:51
Something like this:

select * from phone_calls,prices
 where phone_calls.called_number like prices.code||'%'
 and length(prices.code)=(select max(length(prices2.code)) from prices prices2 where phone_calls.called_number like prices2.code||'%');


regards,
Zoltán Patalenszki

Re: Compare two tables and get a new table [message #350494 is a reply to message #350485] Thu, 25 September 2008 03:50 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
raed_237 wrote on Thu, 25 September 2008 10:40

it gave an error with the (by prefix desc)
i don't know why, it says Prefix: invalid identifier




I wrote it on the fly and without a test case I couldn't test it. You should change prefix with name of the column for the area-codes ( number prefixes ).

And remember that you get the total cost of the call like Rajuvan just pointed out. To get just the cost per minute don't multiply the price column for minutes, but jut use the price column.


Bye Alessandro

[Updated on: Thu, 25 September 2008 03:51]

Report message to a moderator

Re: Compare two tables and get a new table [message #350497 is a reply to message #350391] Thu, 25 September 2008 03:52 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
and this one works as well ... many thanks rajavu1, though i didn't know what XT stands for Embarassed

rajavu1 wrote on Thu, 25 September 2008 06:36
Solution using Row generator technique is

SELECT Called_Number,
       Minutes, 
       Destination,
       Code,
       Price 
       FROM (
select CT.*,
       PT.*,
       RANK() OVER (PARTITION BY CALLED_NUMBER,MINUTES   ORDER BY  XT.l DESC ) RNk
        from call_time CT,
             ( select level l from dual connect by level <8) XT ,
             PRICE_TAB PT
        WHERE SUBSTR(CT.CALLED_NUMBER,1,l) =  PT.Code)
WHERE RNK=1


Thumbs Up
Rajuvan.

Re: Compare two tables and get a new table [message #350499 is a reply to message #350494] Thu, 25 September 2008 04:12 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
strange it works fine but it stops after only 13,000 records, more than 30,000 are missing Confused


Alessandro Rossi wrote on Thu, 25 September 2008 11:50
raed_237 wrote on Thu, 25 September 2008 10:40

it gave an error with the (by prefix desc)
i don't know why, it says Prefix: invalid identifier




I wrote it on the fly and without a test case I couldn't test it. You should change prefix with name of the column for the area-codes ( number prefixes ).

And remember that you get the total cost of the call like Rajuvan just pointed out. To get just the cost per minute don't multiply the price column for minutes, but jut use the price column.


Bye Alessandro

Re: Compare two tables and get a new table [message #350502 is a reply to message #350174] Thu, 25 September 2008 04:18 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

@ Alessandro Rossi ,

Actually , One Primary key is missing in Second table . There can be one than One call made to same Number with same duration . like ..

96170690185	1.1333
96170690185	1.1333


ie, two calls to the same number with same duration .
In this case . your query may fail to produce two rows . it will produce just One row ( this can be resolved also ) .

Actually , in reall scenario One more candidate key will be there in second table like Call Time. Not More than One call can be made to same number .

@raed_237

XT is a row generator technique .

Row Generator technique

Thumbs Up
Rajuvan.
Re: Compare two tables and get a new table [message #350503 is a reply to message #350499] Thu, 25 September 2008 04:18 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
I would use minus between one of others and it to see what it misses.

In my opinion it had to give the same output of raed_237's query.

Bye Alessandro


Re: Compare two tables and get a new table [message #350504 is a reply to message #350502] Thu, 25 September 2008 04:23 Go to previous messageGo to next message
Alessandro Rossi
Messages: 166
Registered: September 2008
Location: Rome
Senior Member
Yes you are right a date field to say when the call was made is missing too, and wouldn't use area code as primary key because once the phone company decides to change it you must change all foreign keys too.

But these are details that shouldn't matter to solve this problem, probably the OP didn't introduce them to keep our attention on the data involved in that operation.

Bye Alessandro
Re: Compare two tables and get a new table [message #350506 is a reply to message #350174] Thu, 25 September 2008 04:25 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
thx everybody...i really appreciate your help Smile
Re: Compare two tables and get a new table [message #350546 is a reply to message #350174] Thu, 25 September 2008 06:28 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
alright now i have starting time-we still can have more than one call at the same time
so here is the new format


Start_Time            Called_Number      total-minutes
-----------------------------------------------------------------
9/23/2008 23:53       9647808181238       2
9/23/2008 23:53       9647808121888       3 
9/23/2008 23:56       9647808181877       3.4 
9/23/2008 23:56       2347808181888       0.78 
9/23/2008 23:52       9444780816888       7.89
9/23/2008 23:52       9647808181888       3.67 


Re: Compare two tables and get a new table [message #350632 is a reply to message #350174] Thu, 25 September 2008 12:54 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Quote:
Still can have more than one call at the same time


No.. There are only One Call at a time against Same Number here also.

Thumbs Up
Rajuvan.
Re: Compare two tables and get a new table [message #350952 is a reply to message #350632] Sun, 28 September 2008 02:13 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
that is true... Smile
Compare Two Tables and generate the differences in the third (merged 3) [message #384346 is a reply to message #350174] Tue, 03 February 2009 08:28 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
Hi all,
i have two tables each contains destination, code and price as follows:

Table A

Destination ----- Code ---- Price
UK-----------------44--------0.2
USA----------------1---------0.3
UK-Mobile----------4476------0.28
USA-Mobile---------122-------034

Table B

Destination ----- Code ---- Price
UK-----------------44--------0.2
USA----------------1---------0.3
UK-Mobile----------4476------0.28
USA-Mobile---------122-------0.34
India-Mobile--------33-------0.21

so each table has different data, what i need is to find what destinations are not in table A but in Table B, and put the result into table C as follows:

Table C

Destination ----- Code ---- Price
India-Mobile--------33-------0.21

as the names could be in different formats, we need to depend on the Code as our primary key.

many thanks in advance.
Re: Compare Two Tables and generate the differences in the third [message #384349 is a reply to message #384346] Tue, 03 February 2009 08:36 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you & please be consistent & correct in your postings.

Post DDL for tables.
Post DML for test data.

Post expected/desired results.


Why do you have 2 tables with same fields?
Practice Third Normal Form.

use MINUS

[Updated on: Tue, 03 February 2009 08:36]

Report message to a moderator

Re: Compare Two Tables and generate the differences in the third [message #384351 is a reply to message #384346] Tue, 03 February 2009 08:42 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
Do NOT post same problem more than once
Re: Compare Two Tables and generate the differences in the third [message #384352 is a reply to message #384346] Tue, 03 February 2009 08:43 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
Do NOT post same problem more than once
Re: Compare Two Tables and generate the differences in the third [message #384362 is a reply to message #384346] Tue, 03 February 2009 09:00 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
MINUS

Regards
Michel
Re: Compare two tables and get a new table [message #384408 is a reply to message #350952] Tue, 03 February 2009 12:38 Go to previous messageGo to next message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
bump
Re: Compare Two Tables and generate the differences in the third (merged 3 + really old one) [message #384497 is a reply to message #350174] Wed, 04 February 2009 02:00 Go to previous messageGo to next message
raed_237
Messages: 19
Registered: August 2008
Junior Member
hi
sorry for sending this twice, but the forum gave an error so i post the topic again, the other thing is that i am not sure why u did merge the new topic with the old one they are completely different. the other thing is the tables represent two companies prices so what i needed is to pull the destinations that exists in table B but not in table A. the last thing many thanks for your help.
Re: Compare Two Tables and generate the differences in the third (merged 3 + really old one) [message #384507 is a reply to message #384497] Wed, 04 February 2009 02:48 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
sorry for sending this twice, but the forum gave an error so i post the topic again

In this case, you FIRST refresh the forum topic list to check if yours is there and if not THEN you repost.

Regards
Michel
Re: Compare Two Tables and generate the differences in the third (merged 3 + really old one) [message #384521 is a reply to message #350174] Wed, 04 February 2009 03:37 Go to previous message
srinivasreddy777
Messages: 11
Registered: October 2007
Location: Hyderabad
Junior Member

@raed_237

If code is maximum of length 4 we can have 4 select statements with union. please try
Previous Topic: Help me
Next Topic: oracle XML function (merged)
Goto Forum:
  


Current Time: Sat Dec 10 00:59:35 CST 2016

Total time taken to generate the page: 0.26020 seconds