Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updateable view with memo AND group by in vfp8?
Message
De
21/02/2004 16:31:47
 
 
À
21/02/2004 10:26:44
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00879541
Message ID:
00879662
Vues:
15

>
>

>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform