Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Order By in a Union
Message
From
04/05/2009 00:47:00
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01397707
Message ID:
01397711
Views:
42
Actually, it seems to work fine without the padding. I would have thought that would not work, but it does.

Well, at least I can say it does work when there is at least one non-null in the testdata group. I should test for all nulls in testdata, and maybe then it would fail.

I'll check it out.



>>If I leave out the Order By clause, it works, but the results are not ordered like I want.
>
>order by 1 and don't forget to pad with space() or padr() functions when using NVL
>
>like:
>
>Select vendor From CopyTemplateMtl
> Union All
> Select Nvl(vendor,space(10)) as vendor From c:\testdata
> Order By 1
>
>or
>
>Select vendor From CopyTemplateMtl
> Union All
> Select padr(Nvl(vendor,''),10) as vendor From c:\testdata
> Order By 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform