Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group By simple?
Message
From
27/03/2002 13:16:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00637968
Message ID:
00637988
Views:
17
>>>Hi could someone clarify for me if its possible to control the Group By clause of a select statement (ordering doesn't seem to alter the results.
>>>
>>>If my select produced:
>>>
>>>Field1 Field2
>>>  1      a
>>>  1      b
>>>  2      b
>>>  2      a
>>>
>>>After a group by on Field1 how can I get the result to be:
>>>
>>>Field1 Field2
>>>  1      a
>>>  2      a
>>>
>>>Thanks in anticipation.
>>
>>Caroline,
>>What logic outputs like that ? Is that sort on first col then on 2nd ? If so 'simple' group by needs 2 SQL :
>>
>>select * from mySource order by 1, 2 desc into cursor crsTemp nofilter
>>select * from crsTemp group by 1
>>
>>Cetin
>
>Cetin the above is a partial result not ordered or grouped that I then want grouped so that I only have 1 entry for each Field1 key. Ideally I would like to order it so that the results will show 'a' in field2 if there was both an 'a' and 'b' collected.
>
>Does that make any more sense?
>
>This is my select statement.
>
>SELECT ;
>FROM links;
>WHERE Links.itype IN(2,1);
>GROUP BY links.iwork
>
Unfortunately no :) My original sample still fits to what I understand.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform