Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updateable view with memo AND group by in vfp8?
Message
From
21/02/2004 16:31:47
 
 
To
21/02/2004 10:26:44
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00879541
Message ID:
00879662
Views:
14

>
>

>select master.*, cnt(detail.field) as cnt;
> from master;
> join detail on master.key=detail.key;
> group by master.key
>

>
>
>Old Visual FoxPro can do this, but it is out of all SQL standards.

Opinions differ.


this is not a opinion, it is a fact.
You can say that when group by have a fields list it's a Primary key
the ambiguity is resolved,
but i do not known a database package that use this set property directly;
then the only way is to grouping memo or aggregate memo,
- grouping ( that is sorting ) is hard because the memo do not have a short limit,
- aggregate can to be MAX(),MIN(),FIRST(),LAST(),
for MAX() and MIN() is need sorting, then the way is cut,
only FIRST and LAST are possible.

Before VFP8, VFP implement LAST() implicitly ,
but AFAIK only MS Access implement FIRST() explicitly.

In fact the FIRST() and LAST() is very usefull on general case,
but some mysterious reason they are not implemented.
MSSQL2000 implement FIRST() with primary key group like a optimization, but you must write a correct autosubquery for get this!

Perhaps yukon do new somethings.


>- try a join of the parent table with an extra view which would keep just the document key and the cnt(*) from the child table
>
>
>Yes, it is the correct choice.
>It is efficient and the extra view is fast and usable for other task.

That's what I decided to do, thanks for chiming in. Grazie, amico.


E' un piacere.

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform