Link to home
Create AccountLog in
Avatar of Ricky White
Ricky WhiteFlag for United States of America

asked on

Assistance with Sql server query uppercase?

Environment: Sql Server 2000

State:
California
WASHINGTON
UTAH

I have a SQL table and would like to search for all state's that are fully in uppercase.

My Sql query is

Select * from temp
where state = uppercase states

expected results:
WASHINGTON
UTAH

Please advise. how can this be achieved?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Ron Malmstead
Ron Malmstead
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
declare @statelist as varchar(max)

select @statelist=coalesce(@statelist,',')+state from table_name where state=upper(state)

select @statelist
Avatar of Ricky White

ASKER

Thanks!