Link to home
Create AccountLog in
Avatar of Dovberman
DovbermanFlag for United States of America

asked on

How to Return a Column Name from a SQL expression

SELECT
COUNT(*) FROM Exceptions WHERE
PctUp < ((SELECT MAX(PctUp) FROM Exceptions)-1)

Returns the correct value but "No column name)

I tried
SELECT
COUNT(*) FROM Exceptions WHERE
PctUp < ((SELECT MAX(PctUp) FROM Exceptions)-1)
AS LowValue

This resulted in an error.

What should I change?

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of kevinhigg
kevinhigg

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Dovberman

ASKER

Thank you. The article was also helpful.