Oziam Posted November 4, 2010 Share Posted November 4, 2010 HI, I have a table with over 100,000 rows, I want to query just one column and return the data for each different result but only once. In other words, say I have a column named col1, and it has approx 200 different entries in 100,000 rows, so some entries may have 100's of duplicates. I want to return ONLY 1 instance of each unique entry, so I should get 200 unique results not 100,000 with many duplicates. How to do this???? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/217770-simple-database-query-i-think/ Share on other sites More sharing options...
Pikachu2000 Posted November 4, 2010 Share Posted November 4, 2010 SELECT DISTINCT(`col1`) FROM `table` Quote Link to comment https://forums.phpfreaks.com/topic/217770-simple-database-query-i-think/#findComment-1130363 Share on other sites More sharing options...
Oziam Posted November 4, 2010 Author Share Posted November 4, 2010 Yeah that worked great! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/217770-simple-database-query-i-think/#findComment-1130373 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.