A-Lex[FM] очевидно не правильноесли я правильно тебя понял
[sql]Но тогда выбрать одним запросом(без подзапросов) скорее всего не получится
я все же считаю что более корректно будет вот так, тоесть с вложенным запросом:9.3. User Variables
...
Note: In a SELECT statement, each expression is evaluated only when sent to the client. This means that in a HAVING, GROUP BY, or ORDER BY clause, you cannot refer to an expression that involves variables that are set in the SELECT list. For example, the following statement does not work as expected
...
