Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Union incompatibility error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00411393
Message ID:
00411401
Vues:
11
>I get the message "SELECTs are not UNION compatible" when I run the following query:
>
>SELECT c.contact_id,d.issue_id AS Chiave FROM ai_core a ;
> JOIN cextern b ON a.id_agency==b.id_agency ;
> JOIN dcontact c ON b.extern_id==c.extern_id ;
> JOIN dissues d ON c.contact_id==d.contact_id ;
> WHERE c.staff_ext=2 ;
>UNION ;
>(SELECT c.contact_id,d.req_id AS Chiave FROM ai_core a ;
> JOIN cextern b ON a.id_agency==b.id_agency ;
> JOIN dcontact c ON b.extern_id==c.extern_id ;
> JOIN dreqs d ON c.contact_id==d.contact_id ;
> WHERE c.staff_ext=2)
>
>The UNION works fine without the second field, so the problem lies there and not in the individual joins. The first SELECT includes "issue_id" which is CHAR 8 and the second SELECT includes "req_id" which is CHAR 4. I am told that the second part of the union can have fields that are the came data type and equal to or smaller than the comparable fields in the first part, which is the case here. Since the query was bombing, I added the AS title "Chiave" for each, hoping that would make them closer to matching. That doesn't work either.
>
>Any idea why the second field(s) make the UNION fail?? I need to chain these together with others to make a mega report, but I can't seem to get off the ground.
>
>TIA
>
>Jim

Nope, fields must be the same size, too.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform