Using Group By and subqueries in LLBLGen

Posts   
 
    
Katty
User
Posts: 1
Joined: 01-Oct-2013
# Posted on: 01-Oct-2013 15:43:36   

Hi, I am pretty new to LLBLGen style of coding... can you help me rewrite this kind of Sql query using DataAdapter...

Select Temp.CaseType, COUNT(*), AVG(Temp.Age) From( Select Table1.NAME As CaseType, DATEDIFF(day,Table2.OPENED_TIMESTAMP,CURRENT_TIMESTAMP) As Age From Table2 Join Table1 ON Table2.CASE_TEMPLATE_ID = Table1.ID)As Temp Group By Temp.CaseType

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 01-Oct-2013 21:16:21   

You will need to check the manual for different subjects. And I advise you to take it one step at a time, till get used to LLBLGen APIs.

1- Calling a database function

2- Derived tables and dynamic relations

3- Using Group By

4- Field Expressions and Aggregates

I'm assuming you are using the Adapter template, if not please look at the same sections under the SelfServicing.