Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Complex Query
 

Pages: 1
LLBLGen Pro Runtime Framework
Complex Query
Page:1/1 

  Print all messages in this thread  
Poster Message
DaveR
User



Location:

Joined on:
15-Jun-2004 16:37:10
Posted:
43 posts
# Posted on: 27-Sep-2004 17:55:52.  
I am wondering if the following query can be done entirely in code (perhaps using a TypedList), or if I need to resort to a TypedView.

In a nutshell, my DB contains documents, each which contains multiple sections, and each section contains multiple events. I want to return the latest event of a certain type among all of the sections of a particular document.

Code:
SELECT MAX(EventTime) AS LatestEventTime,LatestEditSect.DocumentID FROM
(SELECT MAX(EventTime) AS SectEventTime,DocSectionID
FROM DocSectionEvent
WHERE DocSectionEventTypeID IN (8,12)
GROUP BY DocSectionID) LatestSectEditEvent
INNER JOIN DocSection LatestEditSect ON LatestSectEditEvent.DocSectionID=LatestEditSect.DocSectionID
GROUP BY LatestEditSect.DocumentID
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37806 posts
# Posted on: 27-Sep-2004 19:01:39.  
The virtual table you define in the first FROM clause can't be represented in code. I'm not entirely sure why it is required, perhaps it can be rewritten.

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.