How To Select Unique Rows From Mysql Distinct Keyword Query
Posted On Mon Dec 08, 2008 By Wallpaperama In MySQL Forums And Topics Discussions About Open Source Database Forums
distinct()
ok, lets say you want to do a mysql query but you dont want the quieries to repeat. right.
well, you can do a distinc query in mysql. Getting a list of unique values from a MySQL column is easy if you know how. so how do you select unique rows? there are many ways to select a mysql unique key or mysql unique constraint, but the best and easiest way to get mysql unique index is by mysql unique column which i use for an online mysql guide mysql distinct keyword by selecting unique identifier.
for example, lets say i have these rows:
1. wallpaperama free wallpapers
2. wallpaperama wallpapers
3. wallpaperama free wallpapers
4. free wallpapers
5. free wallpaperama
6. free wallpapers
7. wallpaperama wallpapers
8. free wallpaper
9. wallpaperama free
ok if you look at the 9 rows above, you will see that there are some rows that are identical. so i dont want to select the ones that repeat, i only want the ones that dont repeat which are unique or one of a kind. so this is how my list should come out
1. wallpaperama free wallpapers
2. wallpaperama wallpapers
3. free wallpapers
4. free wallpaperama
5. wallpaperama free
so by doing this, i can gnore duplicate entries in MySQL selecting and using DISTINCT keyword
and this is how my sql querie would look like:
$sql = "SELECT DISTINCT(keywords) FROM searches ORDER BY id ASC";
Related Content
Information
Forums »
MySQL Forums And Topics Discussions About Open Source Database »
How To Select Unique Rows From Mysql Distinct Keyword Query
MySQL Forums And Topics Discussions About Open Source Database »
How To Select Unique Rows From Mysql Distinct Keyword Query
Title: How To Select Unique Rows From Mysql Distinct Keyword Query
Description: How To Select Unique Rows From Mysql Distinct Keyword Query
Tags: how ,to ,select ,unique ,rows ,from ,mysql ,distinct ,keyword ,query
Info: This Post Has Been Viewed 0 Times Since
Date: Mon Dec 08, 2008
Author Wallpaperama Received 0 Replies #909
Date: Mon Dec 08, 2008
Author Wallpaperama Received 0 Replies #909
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