in reply to (OT) MySQL select Question
I've actually been working on a module to allow you to mimic subselections in mysql. But alas, it's on the backburner right now.
For this particular case, you could actually just use the following:
select distinctrow table1.* from table1,table2 where table1.category=1 + or (table1.category = table2.id and table2.parent_id = 1);
Hope this helps...and works as it's untested.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (OT) MySQL select Question
by Anonymous Monk on Jul 26, 2003 at 23:00 UTC | |
|
Re: Re: (OT) MySQL select Question
by Beatnik (Parson) on Jul 26, 2003 at 22:31 UTC | |
by antirice (Priest) on Jul 26, 2003 at 22:36 UTC |