Jump to content


Photo

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


  • Please log in to reply
2 replies to this topic

#1 alias47

alias47
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 13 August 2006 - 09:46 PM

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
)
)

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 14 August 2006 - 05:26 AM

You can't mix VALUES with SELECT.  Drop the extra VALUES() clause... it should read INSERT INTO...SELECT ...WHERE....
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 alias47

alias47
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 August 2006 - 11:07 PM

Thanks fenway, that worked




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users