<?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>Alex in a nutshell &#187; SQL</title>
	<atom:link href="http://salamakha.com/blog/category/programming/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://salamakha.com/blog</link>
	<description>Random thoughts on IT</description>
	<lastBuildDate>Mon, 19 Dec 2011 13:40:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Random sort in T-SQL</title>
		<link>http://salamakha.com/blog/2007/07/15/random-sort-in-t-sql/</link>
		<comments>http://salamakha.com/blog/2007/07/15/random-sort-in-t-sql/#comments</comments>
		<pubDate>Mon, 16 Jul 2007 00:29:11 +0000</pubDate>
		<dc:creator>Alex Salamakha</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://salamakha.com/blog/2007/07/15/random-sort-in-t-sql/</guid>
		<description><![CDATA[Recently I had a task to return rows from a SQL Server database in random order. Here is a simple solution: SELECT * FROM MyTable ORDER BY newid() Potential applications include selecting a random tip of the day or a random product of the day for any portal/online shop/etc, which is now simple enough by [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had a task to return rows from a SQL Server database in random order.</p>
<p>Here is a simple solution:</p>
<blockquote><p><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'">SELECT * FROM MyTable ORDER BY newid()</span></p></blockquote>
<p>Potential applications include selecting a random tip of the day or a random product of the day for any portal/online shop/etc, which is now simple enough by typing the following:</p>
<blockquote><p><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'">SELECT TOP 1 * FROM </span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'">MyTable </span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'"> ORDER BY newid()</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://salamakha.com/blog/2007/07/15/random-sort-in-t-sql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

