Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL GROUP BY with MEMO-Field in Fieldlist
Message
From
15/11/2013 13:02:21
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01587998
Message ID:
01588063
Views:
42
>>Me again ;-)
>>
>>Because you asked if a primary key exists: Is there solution whit a primary key without the need to cut the memofield?
>>
>>Gerhard
>>
>Yes.
>
>select T.* from Tab1 T inner join (select Field1, Field2, min(PK) as MinPK from Tab1 GROUP BY Field1, Field2) X 
>ON Tab1.PK = X.MinPK
You can make a sort of PK - two fields together

PartOne + PartTwo is an expression that is very likely to be unique
	select cast(sys(2007, F5, 0, 1) as B(0)) as PartOne, ;
			padr(F5, 200) as PartTwo, ;
			count(*) ;
		from test ;
		group by 1, 2
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform