On Tue, 20 May 2003, Dmitri Bichko wrote:
> I wish it were as easy as a join - the query is much simplified for the
> purpose of the example, in reality the subselect is more complicated and
> includes a GROUP BY (which, at least as far as I know, makes subqueries
> the only way of doing this).
But you may be able to do it as a subselect in FROM rather than a
subselect in IN (err, right).
For example, barring possible NULL related wierdness:
select * from a where col in (select count(*) from b group by col2);
can probably be done as something like:
select a.* from a, (select distinct count(*) as count from b group by
col2) as b where a.col=b.count;
which in some cases for 7.3 and earlier will be better.