Reputation: 419
I want to delete the last row of table.
Query:
delete from NEXG.user_type where `id`=last_insert_id()
id is auto increment key.
id
But it is showing 0 rows affected.
What is the reason behind this?
Upvotes: 0
Views: 108
Reputation: 2500
SIMPLY:
DELETE FROM `user_type` ORDER BY `id` DESC LIMIT 1
Upvotes: 6