Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
I always get an error " virtual column must have explicit name"
I wrote a query to execute and store result in another table..I query does
sum operation on fields with related keys....
↪ replying to SRam
John Carlson — — source: Usenet: comp.databases.informix
On 28 Aug 2003 04:38:57 -0700, aksivaram2k2@yahoo.com (SRam) wrote:
>I always get an error " virtual column must have explicit name"
>
>I wrote a query to execute and store result in another table..I query does
>sum operation on fields with related keys....
If you're selecting into a temp table, then any column with aan
aggregate function requires a column name . . . . e.g.
select company, count(*) comp_count
from some_table
group by 1
into temp som_temp_table
JWC
↪ replying to SRam
Art S. Kagel — — source: Usenet: comp.databases.informix
On Thu, 28 Aug 2003 07:38:57 -0400, SRam wrote:
> I always get an error " virtual column must have explicit name"
>
> I wrote a query to execute and store result in another table..I query does
> sum operation on fields with related keys....
You need to name the virtual columns created by the SUM aggregation function
using a column alias, ala:
select colone, coltwo, SUM( colthree ) AS sum_of_three
from mytable
INTO TEMP my_temp_table;
This is because the corresponding column in the temp table needs a column name.
When you select from the temp table use the alias to identify the column that
resulted from the aggregation (SUM).
Art S. Kagel
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.