Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a manual record from a SQL
Message
De
17/07/2001 02:10:44
 
 
À
17/07/2001 00:30:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00531353
Message ID:
00531377
Vues:
10
This message has been marked as the solution to the initial question of the thread.
One comment and a solution.
The comment:
Naming an alias GROUP and using it in a query can only cause trouble.
The solution:
create a one record table of any structure, then
SELECT Description AS Descript,Numero FROM GROUP WHERE IRegion>0_ ;
UNION SELECT 'Public',0 FROM OneRecordTable ORDER BY 2
Notes:
1. You don't need to use the AS ... syntax in the UNIONed parts of the query.
2. The length of GROUP.Description must at least be 6 or 'Public' will be truncated in the extra record.
HTH

>In a SQL, I am extracting some records from a table. I want to union that in order to add one record manually at the end. I have a syntax like this:
>
>
>SELECT Description AS Descript,Numero FROM GROUP WHERE IRegion>0_
> UNION SELECT 'Public' AS Descript,0 AS Numero FROM GROUP ORDER BY 2
>
>
>I know this is not the correct syntax. As if I have no record in GROUP, I end up with no result. What is the proper syntax?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform