Re: [GENERAL] Aggregate in Correlated SubQuery

2006-10-15 Thread Andrew - Supernews
On 2006-10-15, Niederland [EMAIL PROTECTED] wrote: Before postgresql 8.1.5, I could do the following to find the first lead that created a prospect in my application. SELECT Lead.LeadID, Prospect.ProspectID FROM Prospect INNER JOIN Lead USING (ProspectID) WHERE Lead.CreationDate

[GENERAL] Aggregate in Correlated SubQuery

2006-10-15 Thread Niederland
Before postgresql 8.1.5, I could do the following to find the first lead that created a prospect in my application. SELECT Lead.LeadID, Prospect.ProspectID FROM Prospect INNER JOIN Lead USING (ProspectID) WHERE Lead.CreationDate = (SELECT MIN(Lead.CreationDate) FROM Lead AS LL WHERE

Re: [GENERAL] Aggregate in Correlated SubQuery

2006-10-15 Thread Niederland
Sorry working to late at night Query works just a typo the following works. WHERE Lead.CreationDate = (SELECT MIN(LL.CreationDate) FROM Lead AS LL WHERE LL.ProspectID = Lead.ProspectID) sorry for the previous post, Roger Niederland wrote: Before postgresql 8.1.5, I could do the