[thelist] SQL subqueries in mySQL 3.23.54
Joshua Olson
joshua at waetech.com
Mon Mar 1 21:03:01 CST 2004
> -----Original Message-----
> From: Joshua Olson
> Sent: Monday, March 01, 2004 5:04 PM
>
> I wish I knew the answer, but off-hand I don't. Sorry. :-( If this
> question hasn't been solved by later tonight I'll take a concerted stab at
> it, but my gut reaction is that this problem isn't solvable without temp
> tables and without subselects.
After spending a few more minutes on this I don't believe that this can be
done in a single query in MySQL 3.x. I'll think about it again after a
night's rest, but I'm pretty sure you'll need a temp table or a structure
change.
Here's one possible solution involving a structure change--if you could add
a pair of fields to the primary table, you could maintain a count of the
number of records in the other two tables and make your query very simple.
SELECT * FROM A
WHERE countb > countc
Good night,
<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168
More information about the thelist
mailing list