How To Get The Number Of Unique Items In A Column From A Mysql Query
Posted On Wed Dec 08, 2010 By dubars5 In MySQL Forums And Topics Discussions About Open Source Database Forums
hi, i find your tutorials very helpful, but i have a question, i need to know how to get the number of unique items in a column from a mysql query
i have been breaking my head and finally i am giving up
what do you suggest? please reply promptly.
i have been breaking my head and finally i am giving up
what do you suggest? please reply promptly.
wallpaperama Wed Dec 08, 2010
you use the DISTINCT() in your query.
for example, lets say you have a database of your users, and you want to know which users have their name john, you can use this query like this:
$query= "SELECT DISTINCT(UserName) FROM Users ORDER BY UserName ASC";
hope that helps
for example, lets say you have a database of your users, and you want to know which users have their name john, you can use this query like this:
$query= "SELECT DISTINCT(UserName) FROM Users ORDER BY UserName ASC";
hope that helps
Related Content
Information
Forums »
MySQL Forums And Topics Discussions About Open Source Database »
How To Get The Number Of Unique Items In A Column From A Mysql Query
MySQL Forums And Topics Discussions About Open Source Database »
How To Get The Number Of Unique Items In A Column From A Mysql Query
Title: How To Get The Number Of Unique Items In A Column From A Mysql Query
Description: please show me how to get the number of unique items in a column from a mysql query so i can display all the unique strings from the sql database
Tags: mysql , unique , php , query , database
Info: This Post Has Been Viewed 0 Times Since
Date: Wed Dec 08, 2010
Author dubars5 Received 1 Replies #921
Date: Wed Dec 08, 2010
Author dubars5 Received 1 Replies #921
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5