I'm used to MS sql so working with mySql is sure to throw some syntax error at me that is bound to slow me down. I have the following:
declare @expensesSum DOUBLE
select @expensesSum = sum(expenseAmount) from bondsaverdb.expenses
insert into bondsaverdb.expenses
select '6','Extracash',(income - @expensesSum) from bondsaverdb.income where userName ='Dean'
The error I'm getting says:
syntax error near declare @expensesSum
Must be the way I'm declaring the variable??
Thanks in advance!