Re: select.. where like query with 'subquery'?

From: Donkey Hot <spam_at_plc.is-a-geek.com>
Date: 06 Jun 2008 22:12:33 GMT
Message-ID: <Xns9AB6C4D32608SH15SGybs1ysmajw54s5@194.100.2.89>


"buu" <aha_at_a.com> wrote in news:g2cafc0k9h_at_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. Received on Fri Jun 06 2008 - 17:12:33 CDT

Original text of this message