I'd like to reference values returned by a subselect in the same SELECT
query.
Example:
SELECT id,
( SELECT COUNT(*) FROM second ) AS value_to_reference,
( value_to_reference + 1 ) AS value_that_uses_referenced_one
FROM first;
Any suggestions?
Thank you,
Marco