Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Group by query
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00355597
Message ID:
00355608
Views:
17
Gerard,

How about...

SELECT MAX(Fld1),
MAX(Fld2)
FROM MyFile
GROUP BY Fld1
INTO CURSOR Temp

Hope this helps,



Gerard wrote -

I have a file as follows:

Fld1 Fld2
_____________________________
AA Widgets
AA
AA
AA
BB Spark Plugs
BB
BB
CC
CC Emeralds
DD


______________________________

I want to do following
Select * from MyFile Group by Fld1 into Cursor temp

.. but I want to ensure that I always get the description, if there is one in the result i.e. I need the following:
(I will only have spaces or the same value)

AA Widgets
BB Spark Plugs
CC Emeralds

I'm wondering is there a SQL way of doing this, or maybe some other way ?

Regards,

Gerard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform