I believe you are missing a + in the COUNT(*) statement, right after the ''

--- Thomas Eldred <[EMAIL PROTECTED]> wrote:

> Can someone help me figure out what I am doing wrong? Am attempting to create
> three views to gather some aggregate information and then union them into
> one.
> 
> Using the code below, It shows no errors in R:Style, but I get an illegal
> collumn specification error when running.
> 
> Here is the code, and thank you
> 
> CREATE VIEW electcommrben    +
> (typecount, employtype, +
> avgchair, avgvc,avgmem, avgcommr, minboard, +
> maxboard, avgboard)  +
> AS SELECT +
> COUNT(*),(t1.selectionmethod+' ' t1.service)  ,  +
> AVERAGE(chairmansalary) ,  +
> AVERAGE(vicechairsalary)  , +
> AVERAGE(membersalary) 
> ,AVERAGE((chairmansalary+vicechairsalary+membersalary)/3), +
> MIN(chairmansalary+vicechairsalary+membersalary), +
> MAXIMUM(chairmansalary+vicechairsalary+membersalary), +
> AVERAGE(chairmansalary+vicechairsalary+membersalary) +
> FROM miscommrs t1  WHERE mcyear = 2002 AND selectionmethod = 'elected' AND
> service = 'Part time'
> 
> 
> CREATE VIEW apptpartben   +
> (typecount, employtype, +
> avgchair, avgvc,avgmem, avgcommr, minboard, +
> maxboard, avgboard)  +
> AS SELECT +
> COUNT(*),(t1.selectionmethod+' ' t1.service) ,  +
> AVERAGE(chairmansalary) ,  +
> AVERAGE(vicechairsalary)  , +
> AVERAGE(membersalary)  , +
> AVERAGE((chairmansalary+vicechairsalary+membersalary)/3), +
> MIN(chairmansalary+vicechairsalary+membersalary), +
> MAXIMUM(chairmansalary+vicechairsalary+membersalary), +
> AVERAGE(chairmansalary+vicechairsalary+membersalary) +
> FROM miscommrs t1  WHERE mcyear = 2002 AND selectionmethod = 'appointed' AND
> service = 'Part time'
> 
> CREATE VIEW apptfullben +
> (typecount, employtype, +
> avgchair, avgvc,avgmem, avgcommr, minboard, +
> maxboard, avgboard)  +
> AS SELECT +
> COUNT(*),(t1.selectionmethod+' ' t1.service) ,  +
> AVERAGE(chairmansalary) ,  +
> AVERAGE(vicechairsalary)  , +
> AVERAGE(membersalary)  , +
> AVERAGE((chairmansalary+vicechairsalary+membersalary)/3), +
> MIN(chairmansalary+vicechairsalary+membersalary), +
>
MAXIMUM(chairmansalary+vicechairsalary+membersalary),AVERAGE(chairmansalary+vicechairsalary+membersalary)
> +
> FROM miscommrs t1 WHERE mcyear = 2002 AND selectionmethod = 'appointed' AND
> service = 'Full time'
> 
> CREATE VIEW apptcommrben +
> AS SELECT * FROM apptpartben +
> UNION +
> SELECT * FROM apptfullben
> 
> CREATE VIEW commrbenes   +
> AS SELECT * FROM electcommrben +
> UNION +
> SELECT * FROM apptcommrbenes
> RETURN


=====
Albert Berry 
Management Consultant
RR2 - 1252 Ponderosa Drive
Sparwood BC, V0B 2G2 
Canada
(250) 425-5806
(250) 425-7259
(708) 575-3952 (fax)
[EMAIL PROTECTED]

Reply via email to