xxxcr Posted November 12, 2012 Share Posted November 12, 2012 (edited) Hi, I need to find the mode of price for multiple different locations. The way I have the query now returns the mode over the entire data set- but not location by location: SELECT top 1 COUNT (*)frequency, price mode, locatFROM TicketsWHERE locat in ('017','018','030')group by locat, priceorder by COUNT (*) desc result:frequency mode locat361 26.00 017 Help on the fixing this would be greatly appreciated!! Edited November 12, 2012 by xxxcr Link to comment Share on other sites More sharing options...
justsomeguy Posted November 12, 2012 Share Posted November 12, 2012 Removing "top 1" would be a good start, that tells it to only return 1 record. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now