<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Alexander Kuznetsov : Set based logic</title><link>http://sqlblog.com/blogs/alexander_kuznetsov/archive/tags/Set+based+logic/default.aspx</link><description>Tags: Set based logic</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Set based calculation of products of several numbers.</title><link>http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/03/17/set-based-calculation-of-products-of-several-numbers.aspx</link><pubDate>Tue, 17 Mar 2009 22:01:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:12714</guid><dc:creator>Alexander Kuznetsov</dc:creator><slash:comments>10</slash:comments><comments>http://sqlblog.com/blogs/alexander_kuznetsov/comments/12714.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/alexander_kuznetsov/commentrss.aspx?PostID=12714</wfw:commentRss><description>You can use SUM to calculate the sum of several numbers, but you cannot directly use set-based logic to calculate a product. Yet there is a very simple trick – you can use EXP(SUM(LOG(…))) and get a product of several numbers without a loop. The trick...(&lt;a href="http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/03/17/set-based-calculation-of-products-of-several-numbers.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=12714" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/alexander_kuznetsov/archive/tags/Brainteasers/default.aspx">Brainteasers</category><category domain="http://sqlblog.com/blogs/alexander_kuznetsov/archive/tags/Set+based+logic/default.aspx">Set based logic</category><category domain="http://sqlblog.com/blogs/alexander_kuznetsov/archive/tags/SQL/default.aspx">SQL</category><category domain="http://sqlblog.com/blogs/alexander_kuznetsov/archive/tags/Transact+SQL/default.aspx">Transact SQL</category></item></channel></rss>