Jump to content

Archived

This topic is now archived and is closed to further replies.

alias47

#1136 - Column count doesn't match value count at row 1

Recommended Posts

I'm getting the above error with the following SQL Statement.  I cannot seem to find the error in the code.  The select statement does pull multiple rows.

I'm using my SQL version:  4.1.19

Any clue on why this isn't working?
Thanks,

INSERT INTO `Grants` ( `Project_Code` , `Grant_Code` , `Fiscal_Year` , `Capital` )
VALUES (
(
SELECT Project_Code, Grant_Code, FY, SUM( Capital )
FROM Grants_Temp
WHERE Project_Code = 'OSUT'
AND FY = '2006'
AND Claim_Month = '072006'
GROUP BY Grant_Code
ORDER BY Grant_Code
)
)

Share this post


Link to post
Share on other sites
You can't mix VALUES with SELECT.  Drop the extra VALUES() clause... it should read INSERT INTO...SELECT ...WHERE....

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.