<?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>How To PHP - PHP Technology, PHP Tutorial, Database Tutorials, CMS System &#187; Mysql Interview</title>
	<atom:link href="http://www.phpmind.com/blog/category/interview-questions/mysql-interview-questions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmind.com/blog</link>
	<description>Future of web development</description>
	<lastBuildDate>Tue, 25 Oct 2011 21:38:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to remove duplicate entries from a table ?</title>
		<link>http://www.phpmind.com/blog/2010/04/how-to-remove-duplicate-entries-from-a-table/</link>
		<comments>http://www.phpmind.com/blog/2010/04/how-to-remove-duplicate-entries-from-a-table/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 21:57:12 +0000</pubDate>
		<dc:creator>om</dc:creator>
				<category><![CDATA[Mysql Interview]]></category>

		<guid isPermaLink="false">http://www.phpmind.com/blog/?p=570</guid>
		<description><![CDATA[Removing Duplicate entries from Mysql database table are really simple. I have found some times interviewer ask tricky questions like this. PHP-MYSQL Beginners  just be careful ! It can all be done with three manual SQL steps! No PHP Coding required, and it works with MySQL 4 and above versions. Step One - View Code [...]]]></description>
			<content:encoded><![CDATA[<p>Removing Duplicate entries from Mysql database table are really simple. I have found some times interviewer ask tricky questions like this. PHP-MYSQL Beginners  just be careful !</p>
<p>It can all be done with three manual SQL steps! No PHP Coding required, and it works with MySQL 4 and above versions.</p>
<p><strong>Step One</strong> -</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code4'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5704"><td class="code" id="p570code4"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> MyNewTable <span style="color: #993333; font-weight: bold;">as</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> MyOldTable <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">column</span> <span style="color: #993333; font-weight: bold;">to</span> remove duplicates <span style="color: #993333; font-weight: bold;">by</span><span style="color: #66cc66;">&#93;</span>;</pre></td></tr></table></div>

<p><strong>Step Two</strong> &#8211; You hate to keep old  table with all the duplicate entries, so drop it!</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code5'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5705"><td class="code" id="p570code5"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> MyOldTable;</pre></td></tr></table></div>


<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code6'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5706"><td class="code" id="p570code6"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">RENAME</span> <span style="color: #993333; font-weight: bold;">TABLE</span> MyNewTable <span style="color: #993333; font-weight: bold;">TO</span> MyOldTable;</pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.phpmind.com%2Fblog%2F2010%2F04%2Fhow-to-remove-duplicate-entries-from-a-table%2F&amp;title=How%20to%20remove%20duplicate%20entries%20from%20a%20table%20%3F" id="wpa2a_2"><img src="http://www.phpmind.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.phpmind.com/blog/2010/04/how-to-remove-duplicate-entries-from-a-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

