Home » SQL & PL/SQL » SQL & PL/SQL » .. Where myid=yourid
.. Where myid=yourid [message #18828] Sun, 17 February 2002 17:58 Go to next message
diaz
Messages: 58
Registered: October 2001
Member
hi,
i have one query like this :
select myid,myname from mytable, yourtable where
myid=yourid

the thing is ..
myid is in varchar(10)
yourid is in varchar(7)

if myid is in : 0218191102
the 'same' id in your id is : 8191102

how can i manage that selection on the where clause ?

thank you
Re: .. Where myid=yourid [message #18829 is a reply to message #18828] Sun, 17 February 2002 18:41 Go to previous messageGo to next message
diaz
Messages: 58
Registered: October 2001
Member
humm..
found the query :

select jumtag from tagihan01,aktivasi where
substr(tagihan01.msisdn,6)=substr(aktivasi.msisdn,4);

but
error :

ERROR at line 1:
ORA-01652: unable to extend temp segment by 128 in tablespace TEMP

can somebody explain this ?
thanks
Re: .. Where myid=yourid [message #18843 is a reply to message #18828] Mon, 18 February 2002 08:55 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
try this:
select * from mytable a,yourtable b
where a.myid like '%'||b.yourid
Re: .. Where myid=yourid [message #18848 is a reply to message #18828] Mon, 18 February 2002 21:11 Go to previous message
diaz
Messages: 58
Registered: October 2001
Member
Hmm..
i don't get it ..

myid yourid
===== ======
x 0218191102 8191102
y 02182012345 82012345

i tried these :

1. select * from mytable a,yourtable b
where a.myid like '%'||b.yourid

2. select * from mytable a,yourtable b
where substr(a.myid,3)=yourid

3. select * from mytable a,yourtable b
where substr(a.myid,-7)=yourid

they only return the record like the 'y' sample
the 'x' is not retrieved.....

how come ??
Previous Topic: Reason of SQL Performance
Next Topic: append records
Goto Forum:
  


Current Time: Thu Apr 25 22:46:29 CDT 2024