<?xml version="1.0"?><rss version="2.0"><channel><title>Comments on Useful SQL Snippet - AddedBytes.com</title><link>http://www.addedbytes.com/article/useful-sql-snippet/</link><description>Latest comments on Useful SQL Snippet on AddedBytes.com</description><!-- ckey="76C662BB" --><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by seo la ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Benjamin's solution is amazing. 
&lt;br /&gt;Nice way to use logical expressions for sql queries, i was looking for that</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Dave Child ( &lt;a href="http://www.addedbytes.com"&gt;http://www.addedbytes.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Hi Benjamin,&lt;br /&gt;&lt;br /&gt;I am using a very odd version of MySQL indeed ... SQL Server :)&lt;br /&gt;&lt;br /&gt;Probably should have made that clearer before. Sorry.</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Benjamin Wilger ( &lt;a href=""&gt;&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;hm sounds strange. Maybe you use a very old version of MySQL (3.23)? MySQL should allow expressions inside of ORDER BY clauses in Versions above 4.&lt;br /&gt;&lt;br /&gt;Greetings,&lt;br /&gt;Ben</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Dave Child ( &lt;a href="http://www.addedbytes.com"&gt;http://www.addedbytes.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;I had some problems with Benjamin's solution (kept getting an error saying &quot;Incorrect syntax near '&gt;'.&quot;). I changed it to this (virtually the same) and it worked fine:&lt;br /&gt;&lt;br /&gt;ORDER BY (cast(ProductStock as bit)) DESC</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Tino ( &lt;a href="http://computeragency.de"&gt;http://computeragency.de&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Can't believe - it works. Thanks lot!</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by The King ( &lt;a href="http://adiazar.blogspot.com"&gt;http://adiazar.blogspot.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Thanks for sharing!</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Ad ( &lt;a href="http://www.adiazar.com"&gt;http://www.adiazar.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Benjamin rocks!</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Bandolino ( &lt;a href="http://www.bandolinoshoes.us/"&gt;http://www.bandolinoshoes.us/&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Thanks Benjamin, That's indeed a great solution. :)</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Loke Krongaard Hansen ( &lt;a href="http://pagerank-boost.com"&gt;http://pagerank-boost.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;A plain and elegant solution indeed.&lt;br /&gt;Both thumbs up !!</description></item><item><title>Comment on Useful SQL Snippet</title><link>http://www.addedbytes.com/article/useful-sql-snippet/comments/</link><guid>http://www.addedbytes.com/article/useful-sql-snippet/comments/</guid><description>Comment by Guilherme Zühlke O'Connor ( &lt;a href="http://www.z-oc.com"&gt;http://www.z-oc.com&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Ben, yours is a very nice and elegant solution.&lt;br /&gt;&lt;br /&gt;I understood it when I saw it, that's why I said it makes sense, but I wouldn't have think of it myself, I guess (Perhaps now I would...)&lt;br /&gt;&lt;br /&gt;I would be searching for a number, not a &quot;boolean&quot; for that field.</description></item></channel></rss>