Hi, Select closing From balance Where account_no = 12 Limit 1 returns an error "You can't specify target table 'balance' for update in FROM clause"
Where is mistake?
Thanks

AFTER INSERT ON Close
BEGIN
Insert into balance (date, opening, account) 
Values (CURDATE(), (Select closing From balance Where account_no = 12 Limit 1), 12);
END

Recommended Answers

All 2 Replies

Hello

Your mistake! You cannot do that !

-----
tesu

I tried but didn't work. I dont use this logic. Therefore, ignore this post.
Thanks for your reply tejusi/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.