Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Re: SQL
Miscellaneous
Thread ID:
00214267
Message ID:
00214269
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform