Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECTing based on Memo contents
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00759395
Message ID:
00760542
Vues:
24
Thanks for the inspiration, Yuri. This is the code that finally gave me the list I was expecting:
SELECT ;
	areakode, stakode, deviceid, relayminor, relaymajor, ;
		IIF(EMPTY(relaymajor),"   ",stakode)+ ;
		IIF(EMPTY(relayminor),"   ",stakode) AS cGroup1 ;
	FROM premaint!premaint ;
	GROUP BY deviceid,cGroup1  ORDER BY deviceid
It turns out that the IIF(EMPTY(relaymajor)," ",STR(RECNO('premaint'),4)) was always giving me the RECNO() of the last record, resulting in fewer than expected records; that must be something unique to VFP7's implementation of the SQL SELECT syntax.
Your suggestion to add HAVING CNT(*)=1 also gave me too few records; I was really looking for HAVING CNT(*)>0 which is the default behavior. Perhaps I was not clear in my initial request.
Randy Bosma
VFP - Because life is too short to code in something else...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform