SetToLoki Posted May 22, 2009 Share Posted May 22, 2009 I am looking for the right phrase to use if I want to search a database for all unique instances of a field. ie say the field is topic and I have 6 entries 1, 1, 2, 3, 4, 6 I would like to return how many unique entries there is and what they are so in my example there is 5 unique entries and they are 1,2,3,4,6 hope thats understandable - I would of searched for it but I am at a loss of what to search for caus I am not even sure what I want can be done Quote Link to comment https://forums.phpfreaks.com/topic/159294-mysql-query-help/ Share on other sites More sharing options...
jackpf Posted May 22, 2009 Share Posted May 22, 2009 DISTINCT is probably what you want. Quote Link to comment https://forums.phpfreaks.com/topic/159294-mysql-query-help/#findComment-840112 Share on other sites More sharing options...
SetToLoki Posted May 22, 2009 Author Share Posted May 22, 2009 DISTINCT is probably what you want. thanks will do some searching now Quote Link to comment https://forums.phpfreaks.com/topic/159294-mysql-query-help/#findComment-840113 Share on other sites More sharing options...
fenway Posted May 22, 2009 Share Posted May 22, 2009 Just remember DISTINCT in **NOT** a function. Quote Link to comment https://forums.phpfreaks.com/topic/159294-mysql-query-help/#findComment-840192 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.