Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a manual record from a SQL
Message
From
17/07/2001 02:10:44
 
 
To
17/07/2001 00:30:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00531353
Message ID:
00531377
Views:
11
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform