Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to normalize my list
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Trying to normalize my list
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01151443
Message ID:
01151443
Vues:
81
Hello All,

For a client with very denormalized data structures (in an old application), I first wrote a simple SQL-Select to get a list of all the route numbers from the first of 5 route number columns:
SELECT route_no FROM (ClientDataPath+'customer') ;
	GROUP BY route_no  ORDER BY route_no ;
INTO CURSOR RouteList
All works well there. However, this does not:
SELECT route_no AS routenum ;
	FROM (ClientDataPath+'customer') ;
	WHERE .NOT.EMPTY(route_no) ;
UNION ALL ;
SELECT route_no2 AS routenum ;
	FROM (ClientDataPath+'customer') ;
	WHERE .NOT.EMPTY(route_no2) ;
UNION ALL ;
SELECT route_no3 AS routenum ;
	FROM (ClientDataPath+'customer') ;
	WHERE .NOT.EMPTY(route_no3) ;
UNION ALL ;
SELECT rr_1 AS routenum ;
	FROM (ClientDataPath+'customer') ;
	WHERE .NOT.EMPTY(rr_1) ;
UNION ALL ;
SELECT rr_2 AS routenum ;
	FROM (ClientDataPath+'customer') ;
	WHERE .NOT.EMPTY(rr_2) ;
GROUP BY routenum  ORDER BY routenum ;
INTO CURSOR RouteList
Assistance gratefully accepted - apparently I've done something wrong while UNIONing.

Thanx!
Randy Bosma
VFP - Because life is too short to code in something else...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform