Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help with query

Re: Need help with query

From: Slava Krivonos <kvv_at_cmtk.net>
Date: Wed, 20 May 1998 20:43:29 GMT
Message-ID: <01bd8440$a3958360$ab652ca6@none.mcit.com>


It can be but I am afraid too slow:

select * from table1 a, table2 b where a.phno = b.phno or substr(a.phno,1,13) = substr(b.phno,1,13) ... or substr(a.phno,1,1) = substr(b.phno,1,1)

good luck!

Slava

Bob McConnell <bobmc_at_cyberramp.net> wrote in article <35606808.822253027_at_news.internetmci.com>...
> I have two tables:
> table 1 contains company names and phone numbers.
> table 2 contains phone calls made by phone number.
> I need to join the two tables by phone number.
>
> The problem is some companies own a complete exchange so while some
> calls would be a join of company phone number (214)-123-4567 in table
> 1to all phone calls made by (214)-123-4567 in table 2
> other companies need to join (214)-123 to all calls between
> (214)-123-000 and (214)-123-9999
>
> can this be done in a single query?
>
> thanks,
> Bob
>
Received on Wed May 20 1998 - 15:43:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US