Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELE .... UNION problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00846041
Message ID:
00846080
Vues:
37
Randy,

I forgot to mention that the ORDER BY clause in UNION SELECT can only reference columns by number not by name. Anyway UNIONless solution is simplier.
SELECT "1" AS so, part_no As so2, * ;
        FROM bondmat ;
	WHERE stores  ;
	UNION ALL ;
		SELECT "2" AS so, *  FROM bondmat ;
		WHERE .NOT.stores
        ORDER BY 1, 2 ;
	INTO TABLE rcursor
>Sergey-
>
>Thanks for your prompt-as-usual help.
>
>The revised statement gives me the same error; it still complains that the Order By clause is invalid. What I was trying to do was group all the 'stores' items in part_no order before all the 'non-stores' items also in part_no order.
>
>The statement w/o the UNION resembles what I used for my index tag. I changed the Order By clause to "so, part_no" and got my desired results. I'll have to slay the UNION dragon in another SQL encounter. ;-)
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform