I tried the following query:
mysql> INSERT INTO tm_visitor (VDT,VID, NAME, CONTACT) values(REPLACE(LE
FT(NOW(), 10), '-', ''),(SELECT LPAD(COALESCE(MAX(VID) + 1, 000001), 6, '0') FRO
M tm_visitor),'yatin','9876543120');
but I get the following error.
ERROR 1093 (HY000): You can't specify target table 'tm_visitor' for update in FROM clause`
What is going wrong and how do I fix it?