Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELE .... UNION problem
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00846041
Message ID:
00846080
Views:
36
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform