Monday, March 19, 2012

Ascending and count help

Below is the statement i am working with and i am trying to figure out
how to have the count in ascending order...is this possible? Right now
it groups by FP in alphabetical order but i dont want that i want the
whatever the FP1 count is to be ascending but i am not sure how to go
about doing this...so any help or ideas?

SELECT FP1 AS FP, COUNT(FP1) AS Expr1
FROM dbo.FP1
WHERE (FP1 IS NOT NULL) AND (LTRIM(RTRIM(FP1)) <> '')
GROUP BY FP1ORDER BY is the way (the only way) to sort the result of a query.

Just add

ORDER BY expr1

--
David Portas
SQL Server MVP
--|||Thank you...that worked :)

David Portas wrote:
> ORDER BY is the way (the only way) to sort the result of a query.
> Just add
> ORDER BY expr1
> --
> David Portas
> SQL Server MVP
> --|||Thank you...that worked :)

David Portas wrote:
> ORDER BY is the way (the only way) to sort the result of a query.
> Just add
> ORDER BY expr1
> --
> David Portas
> SQL Server MVP
> --

No comments:

Post a Comment