MySQL select problem

  • Thread starter Thread starter Tina Fisher
  • Start date Start date
T

Tina Fisher

sorry if this is off-topic here, perhaps someone can help:

in mysql, I would like to have the following:

a select statement that displays a table that should "work" somewhat
like this:

SELECT field1, ( COUNT(field2) ... WHERE A) / ( COUNT(field2) ...
WHERE B) GROUP BY field2

the problem is, in this division, the first COUNT should yield another
number than the second COUNT (different WHERE clauses - I want the
ratio of entries of field2 with propertity A to the entries with
property B - A is a subset of B though !)

how do I do this without a nested SELECT which MySql does not support?

thanks a lot in advance,

<<< Tina >>>
 
I guess, no way, if it does not support nested select. Try newsgroup
microsoft.public.sqlserver.programming - there are people extremely proficient
in relational queries, this puzzle will certainly attract their attention.

good luck.
 
Back
Top