Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: SELECT UNION bad fieldname with a order pass
Message
De
06/09/2005 15:25:56
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01046830
Message ID:
01047138
Vues:
8
>Funny <g> The whole reply consists of my name and quotes :) Anyway, I would always write
>select col1 colMyName, ...
>union
>select col2 colMyName, ...
>
>
>>>Hi Fabio,
>>>

I replay here ( UT have a cross message link )
>>Hi Fabio,
>>
>>I agree with David and Sergey. Why do we want to create inconsistent names to begin with and then try to blame Visual FoxPro for not resolving it properly? Even if this is a bug, it's a bug that was provoked on purpose.
>>
>
>Naomi,
>

1.
In a consistent grammar (the language), what it can be written without error is never inconsistent, otherwise the language is inconsistent.

2.
A simple example,
is more readable sol A or sol B ?
CREATE CURSOR aa (xx i,SS i)
INSERT INTO AA VALUES (1,1)
INSERT INTO AA VALUES (1,1)

CREATE CURSOR bb (yy i,zz i)
INSERT INTO BB VALUES (2,1)
INSERT INTO BB VALUES (2,1)

* sol A
SELECT XX YY,COUNT(*) CNYY	FROM AA GROUP BY YY HAVING CNYY => YY;
UNION ;
SELECT YY YY,COUNT(*) CNYY	FROM BB GROUP BY YY HAVING CNYY => YY

* sol B
SELECT XX YY,COUNT(*) CNYY	FROM AA GROUP BY YY HAVING CNYY => YY;
UNION ;
SELECT YY WW,COUNT(*) CNYY2	FROM BB GROUP BY WW HAVING CNYY2 => WW
3.
complex:
a complex application has 10000 select and allows to combine her in 10000 ways,
in this case a lot of UNION can unite select with different names;
is it reasonable to impose that all the select have the same names to be able to unite her?
This is not a restriction in SQL.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform