Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Union with empty subquery fails
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01519260
Message ID:
01519263
Vues:
36
NEVER MIND!

Upon reviewing the structures for the 5th time I realized they weren't identical.


>I have an SQL union on free tables that fails when one of the subqueries is empty:
>
>
>    SELECT * FROM ROOMBOOK ;
>      WHERE BETWEEN(ROOM_DATE, STARTDATE, ENDDATE) .AND. ;
>            !EMPTY(FOLIO_NBR) ;
>      UNION ;
>      SELECT * FROM RMBKHST ;
>        WHERE BETWEEN(ROOM_DATE, STARTDATE, ENDDATE) .AND. ;
>              !EMPTY(FOLIO_NBR) ;
>      ORDER BY ROOM_DATE, ROOM_NBR ;
>      INTO CURSOR C_ROOMBOOK READWRITE
>
>
>If either of the tables have no matching entries, then I get an error "SELECTs are not UNION compatible. Number of fields do not match."
>
>Can I make this work?
Paul R. Moon
Business Software Solutions
paul@businessoftware.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform