<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Linq to SQL, aggregates and empty results</title>
	<atom:link href="http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/</link>
	<description>What is this?</description>
	<lastBuildDate>Fri, 19 Feb 2010 12:54:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: sshow</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-20492</link>
		<dc:creator>sshow</dc:creator>
		<pubDate>Fri, 19 Feb 2010 12:54:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-20492</guid>
		<description>Thanks for the post! It helped me alot, I did not know that IQueryable.DefaultIfEmpty() was not supported by LinqToSql</description>
		<content:encoded><![CDATA[<p>Thanks for the post! It helped me alot, I did not know that IQueryable.DefaultIfEmpty() was not supported by LinqToSql</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-20371</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 15 Feb 2010 20:47:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-20371</guid>
		<description>does this work with a relationship such as...

var result = (from v in db.Table select (int?)v.Table2.IntColumn).Max()  ?? 0;

If Table2 has no results</description>
		<content:encoded><![CDATA[<p>does this work with a relationship such as&#8230;</p>
<p>var result = (from v in db.Table select (int?)v.Table2.IntColumn).Max()  ?? 0;</p>
<p>If Table2 has no results</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Billy</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-18618</link>
		<dc:creator>Billy</dc:creator>
		<pubDate>Mon, 30 Nov 2009 11:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-18618</guid>
		<description>Thanks couldnt figure this out.</description>
		<content:encoded><![CDATA[<p>Thanks couldnt figure this out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Slay</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-18243</link>
		<dc:creator>Matt Slay</dc:creator>
		<pubDate>Wed, 28 Oct 2009 02:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-18243</guid>
		<description>Thanks. This post quickly helped me with the same problem. However, I could not get the DefaultIfEmpty() suggested by Fil to work. It gave some error like: &quot;Could not format node &#039;OptionalValue&#039; for execution as SQL.&quot;  I was working against a LinqToSql context, maybe that is why. However, the original solution  in the blog post worked just fine. I then had to test the return value for null, and I was fine.</description>
		<content:encoded><![CDATA[<p>Thanks. This post quickly helped me with the same problem. However, I could not get the DefaultIfEmpty() suggested by Fil to work. It gave some error like: &#8220;Could not format node &#8216;OptionalValue&#8217; for execution as SQL.&#8221;  I was working against a LinqToSql context, maybe that is why. However, the original solution  in the blog post worked just fine. I then had to test the return value for null, and I was fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fil Mackay</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-18172</link>
		<dc:creator>Fil Mackay</dc:creator>
		<pubDate>Sun, 18 Oct 2009 12:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-18172</guid>
		<description>A better solution is this, as it does&#039;t interfere with the type:

var result = (from v in db.Table select vIntColumn).DefaultIfEmpty().Max();</description>
		<content:encoded><![CDATA[<p>A better solution is this, as it does&#8217;t interfere with the type:</p>
<p>var result = (from v in db.Table select vIntColumn).DefaultIfEmpty().Max();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-17979</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 16 Sep 2009 16:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-17979</guid>
		<description>Only the third or fourth time I&#039;ve looked this up.  I&#039;ll be back again as soon as I forget why I need this.
Thank you.</description>
		<content:encoded><![CDATA[<p>Only the third or fourth time I&#8217;ve looked this up.  I&#8217;ll be back again as soon as I forget why I need this.<br />
Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rishit</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-17185</link>
		<dc:creator>Rishit</dc:creator>
		<pubDate>Tue, 28 Apr 2009 09:50:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-17185</guid>
		<description>Thanks a lot...Was searching for the result since long time</description>
		<content:encoded><![CDATA[<p>Thanks a lot&#8230;Was searching for the result since long time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serge</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-15614</link>
		<dc:creator>Serge</dc:creator>
		<pubDate>Fri, 14 Nov 2008 09:56:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-15614</guid>
		<description>You have my gratitude as well!
I actually tried everything but your solution.</description>
		<content:encoded><![CDATA[<p>You have my gratitude as well!<br />
I actually tried everything but your solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giulliano Bueno</title>
		<link>http://blog.appelgren.org/2008/05/15/linq-to-sql-aggregates-and-empty-results/comment-page-1/#comment-12470</link>
		<dc:creator>Giulliano Bueno</dc:creator>
		<pubDate>Wed, 11 Jun 2008 00:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.appelgren.org/?p=134#comment-12470</guid>
		<description>Dude,


Thank you so much you have just saved my time. Probably i would be spending few hours in some problem very similar to yours.

:-)</description>
		<content:encoded><![CDATA[<p>Dude,</p>
<p>Thank you so much you have just saved my time. Probably i would be spending few hours in some problem very similar to yours.<br />
 <img src='http://blog.appelgren.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
