Difference between TIMESTAMP DEFAULT, CURRENT_TIMESTAMP, ON UPDATE CURRENT_TIMESTAMP in MYSQL
TIMESTAMP DEFAULT :- in this when new row get inserted or existing row get updated that time current timestamp get inserted.
CURRENT_TIMESTAMP :- in this when row get inserted that time current timestamp get inserted.no change on update.
ON UPDATE CURRENT_TIMESTAMP :- when row get affected that time current timestamp get inserted.
Regards
Prasanna Shejwal
Similar Posts:
- how to reset MySQL root user password with different methods
- Indexes in MySQL
- How to change password – non interactively in simple way
- Ubuntu – GRUB splash image as background for GRUB menu
- Shellshock ‘Deadly serious’ new tech bug found!
- How to swap data in two columns – MySQL
- How to install wordpress on Ubuntu Gusty 7.10
2 Replies to “Difference between TIMESTAMP DEFAULT, CURRENT_TIMESTAMP, ON UPDATE CURRENT_TIMESTAMP in MYSQL”
Hi Prasanna, your blog is informative but the grammar can improve. I did not understand the diff between all these mysqls because of unclear language.
Hi Prasanna,
i hava problam while updating a field in a table and in that Date field which is TIMSTAMP dayatype also updating.
This Date field default value is CURRENT_TIMESTAMP .
I am using this query : “UPDATE cheque_dd_details SET InvoiceNo=? Where UserID=? AND PaidTo=? AND ServiceBuyDate=? AND InvoiceNo IS NULL” ,
in this ServiceBuyDate fiels is TIMESTAMP data type