Path: text.usenetserver.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!news.mixmin.net!feeder.erje.net!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news.banetele.no!uio.no!fi.sn.net!newsfeed1.fi.sn.net!news.song.fi!not-for-mail
Newsgroups: comp.databases.oracle.server
Subject: Re: select.. where like query with 'subquery'?
From: Donkey Hot <spam@plc.is-a-geek.com>
References: <g2cafc0k9h@enews5.newsguy.com>
Message-ID: <Xns9AB6C4D32608SH15SGybs1ysmajw54s5@194.100.2.89>
User-Agent: Xnews/5.04.25
Date: 06 Jun 2008 22:12:33 GMT
Lines: 22
Organization: NBL Networks Oy
NNTP-Posting-Host: 213-157-94-92.localloop.fi
X-Trace: 1212790353 news.nbl.fi 23828 213.157.94.92:3994
X-Complaints-To: abuse@nblnetworks.fi
Xref: usenetserver.com comp.databases.oracle.server:445398
X-Received-Date: Fri, 06 Jun 2008 18:13:02 EDT (text.usenetserver.com)

"buu" <aha@a.com> wrote in news:g2cafc0k9h@enews5.newsguy.com:

> I would like to create a query like this:
> 
> select table1.*, table2.*
>  from table1, table2
>  where table1.id=table2.id
>  and table2.name like %table1.name%
> 
> 
> so, the problem is how to put the last part with LIKE clause wich
> should be from another table..
> anybody any idea? 
> 
> 
> 

You need to re-think your database model.

As is, there is no simple SQL-clause to do it. You need to use dynamic SQL 
to get what you want, if you can't re-structure your data.

