Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL GROUP BY with MEMO-Field in Fieldlist
Message
 
 
À
15/11/2013 12:19:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01587998
Message ID:
01588048
Vues:
50
>Sorry, did not see this before sending my last answer.
>
>I can not cut the memofield. It holds a complete address consiting of multiple lines.
>
>Gerhard
>
>>Assuming first 250 characters is enough:
>>
>>select T.F1, T.F2, T.F3, T.F4, T.F5 FROM ;
>>(select F1, F2, F3, F4, CAST(LEFT(F5,250) AS varchar(2500) as ShortF5 from Tab1 GROUP BY F1, F2, F3, F4, ShortF5) X ;
>>INNER JOIN Tab1 T ON T.F1 = X.F1 AND T.F2 = X.F2 AND T.F3 = X.F3 AND T.F4 = X.F4  AND T.F5 LIKE X.ShortF5+'%' ;
>>ORDER BY T.F1, T.F2, T.F3, T.F4
>>
>>May work longer.

Then you should use John's solution, e.g.
select T.F1, T.F2, T.F3, T.F4
from ...
GROUP BY ... INTO cursor FinalResult READWRITE


ALTER TABLE FinalResult ADD F5 M && hopefully this will work

scan FinalResult

    IF SEEK(F1+F2+F3+F4, 'Tab1', 'FieldsC')
         replace F5 with Tab1.F5 in FinalResult
   end
endscan
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform