<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NewSourceMedia Blog &#187; duplicate</title>
	<atom:link href="http://newsourcemedia.com/blog/tag/duplicate/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Mon, 07 May 2012 01:26:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Select UNIQUE or DISTINCT MySQL/PHP Queries</title>
		<link>http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/</link>
		<comments>http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:09:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL / Database]]></category>
		<category><![CDATA[distinct]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[results]]></category>
		<category><![CDATA[unique]]></category>
		<category><![CDATA[unwanted]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/?p=502</guid>
		<description><![CDATA[How to filter / remove duplicate items in your database query result using DISTINCT Say you wanted to show a list of client names from using a portfolio projects database. The problem is you may have multiple portfolio projects for &#8230; <a href="http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to filter / remove duplicate items in your database query result using DISTINCT

<span id="more-502"></span>Say you wanted to show a list of client names from using a portfolio projects database. The problem is you may have multiple portfolio projects for the same client. So if you ran that list, you could get something like: Nike, Nike, Audi, BMW, BMW, Kmart and Ford. Here is how to clean up all duplicate using the "DISTINCT" clause.

<pre lang="php">$query = "SELECT DISTINCT Client_Name FROM Portfolio ORDER BY Client_Name ASC";
$result = query_db($query);

while ($myrow = mysql_fetch_array($result))
{
echo $myrow.", ";
}</pre>

Notice how we did not add in "limit 0,1". DISTINCT does this for us. It will only return one item.

You want to use it without any other columns, otherwise you are going to need a GROUP BY clause.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MySQL DISTINCT to Remove Duplicate Listing</title>
		<link>http://newsourcemedia.com/blog/mysql-distinct-to-remove-duplicate-listing/</link>
		<comments>http://newsourcemedia.com/blog/mysql-distinct-to-remove-duplicate-listing/#comments</comments>
		<pubDate>Tue, 30 Nov 1999 06:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL / Database]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[clean up]]></category>
		<category><![CDATA[distinct]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[result]]></category>
		<category><![CDATA[uniqe]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/1969/12/31/mysql-distinct-to-remove-duplicate-listing/</guid>
		<description><![CDATA[How to select and display records from MySQL table using the DISTINCT keyword for unique data. This is for removing duplicated results in order to gain unique listings from your database table using the DISTINCT keyword in your MySQL select &#8230; <a href="http://newsourcemedia.com/blog/mysql-distinct-to-remove-duplicate-listing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to select and display records from MySQL table using the DISTINCT keyword for unique data.
<span id="more-165"></span>

This is for removing duplicated results in order to gain unique listings from
your database table using the DISTINCT keyword in your
MySQL select statement .

For example if you ran this:
<pre class="co">Select Cars FROM Cars_Listing
======== Results =======
BMW
BMW
HONDA
BENZ
BENZ
BMW
FORD
FORD
=======================</pre>
Notice how there is more then one BMW.

Here is how to clean up that result by using the DISTINCT keyword in your
MySQL select statement
<pre class="co">Select DISTINCT Cars FROM Cars_Listing
======== Results =======
BMW
HONDA
BENZ
FORD
=======================</pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/mysql-distinct-to-remove-duplicate-listing/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
