Link to home
Start Free TrialLog 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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dovberman

ASKER

Thank you. The article was also helpful.