Distinct and group by

Posts   
 
    
Posts: 28
Joined: 17-Oct-2004
# Posted on: 27-Dec-2004 07:02:18   

I'm using the self servicing approach and was wondering how you could do the following:

SELECT DISTINCT CarID FROM CarView WHERE CarMake = 'Ford'

CarView is of course a view. I thought I could use the group by approach, however I was receiving a run time error on the selectQuery. Also, after I fill the typed view is it possible to generate an ArrayList of all car IDs in the result set (without iterating the result set)?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 27-Dec-2004 10:47:48   

You can retrieve that using a dynamic list. See the dynamic list topic in the typedlist/view documentation

As the typed view is a datatable, there is no way to get a column full of data as an array list, you have to traverse the column.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 28
Joined: 17-Oct-2004
# Posted on: 29-Dec-2004 06:38:47   

It doesn't look like BuildRelationSet exists for typed views and I could not find documentation using a typed view rather than a typed list. Any ideas?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 29-Dec-2004 09:09:38   

DotNetShannon wrote:

It doesn't look like BuildRelationSet exists for typed views and I could not find documentation using a typed view rather than a typed list. Any ideas?

You need the 1.0.2004.1 runtime documentation, if you're still using 1.0.2003.3 and its documentation you need to upgrade.

Frans Bouma | Lead developer LLBLGen Pro