Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Titre:
Re: SQL
Divers
Thread ID:
00214267
Message ID:
00214269
Vues:
15
>Here's a small SQL that's not doing what it is supposed to??
>It gorups the style code...but not the individual sizes. Anybody??
>
>SELECT CUTS_T.STYLE_CD, CUTS_T.SZ1, CUTS_T.SZ2, CUTS_T.SZ3, CUTS_T.SZ4, CUTS_T.SZ5,;
> CUTS_T.SZ6, CUTS_T.SZ7, CUTS_T.SZ8, CUTS_T.SZ9, CUTS_T.SZ10, CUTS_T.SZ11,;
> CUTS_T.SZ12, CUTS_T.SZ13 ;
>FROM CUTS_T;
>GROUP BY 1 ;
>INTO CURSOR zBROWSE ;
>ORDER BY 1
>
>Thanks

How can you group by sizes if each size has its own field? I am assuming the SZ# fields are the size fields. You may be better served if the table structure was like:

Style_CD
Size
Quant [assuming that the current size fields are numeric]

Then you could issue a select like:
select style_cd, size, sum(quant) from cuts_t ;
   group by style_cd, size ;
   into cursor zBrowse
There will be an implicit ordering based on the group by clause, but you can add an explicit order by clause.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform