How can I use the value from an outer clause inside an inner clause using nested SELECT statements? Eg:
SELECT cost AS c, quantity, (SELECT COUNT(1) FROM accounts WHERE cost = c)
FROM accounts
Can c
be referenced in the inner SELECT clause as attempted above?