Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Computed columns
I am trying to create some computed columns as part of a select statement:
SELECT DISTINCT ("qualified_recipient"."response_media_type"),
gbramt = (SELECT SUM("qualified_recipient"."extended_price") FROM
hbramt = (SELECT SUM("qualified_recipient"."extended_price") FROM
ciamt = (SELECT SUM("qualified_recipient"."extended_price") FROM
sspamt = (SELECT SUM("qualified_recipient"."extended_price") FROM
kbamt = (SELECT SUM("qualified_recipient"."extended_price") FROM
gbrcount = (SELECT COUNT("printfile"."printfileid") FROM
"printfile" WHERE ("printfile"."catalogfile" = 'GBR')),
hbrcount = (SELECT COUNT("printfile"."printfileid") FROM
"printfile" WHERE ("printfile"."catalogfile" = 'HBR')),
cicount = (SELECT COUNT("printfile"."printfileid") FROM
"printfile" WHERE ("printfile"."catalogfile" = 'CI')),
sspcount = (SELECT COUNT("printfile"."printfileid") FROM
"printfile" WHERE ("printfile"."catalogfile" = 'SSP')),
kbcount = (SELECT COUNT("printfile"."printfileid") FROM
"printfile" WHERE ("printfile"."catalogfile" = 'KB'))
FROM "printfile",
"qualified_recipient"
I keep getting the error FROM keyword not expected where found ORA-00923.
This same SQL compiles fine against SQL Server and Sybase. Does anyone know the proper Oracle syntax? Received on Mon Feb 23 1998 - 00:00:00 CST