Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with Order By in a Union
Message
De
04/05/2009 00:47:00
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01397707
Message ID:
01397711
Vues:
43
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform