- SELECT
- Order By Rand
- Concat Fields
- Between
- Regexp
- If Null
- Union
- Replace
- Using Syntax
- Substring
- DATE
- Get Date
- Date Format
-
Today
- Month Day
- Date Parts
- ADMINISTRATION
- Foreign Key
- Foreign Key Disable
- Innodb
- Create Database
- Create Table
- Add Column
- Add Index
- Data Type
- Primary Key
- Errors
- Indexes
- Mysqldump
- Table Definition
MYSQL PAGES - LEVEL 3
Now
Returns the current date and time. NOW() returns the time at which the function or triggering statement began to execute. Differs from the behavior for SYSDATE(), which returns the exact time at which it executes.
SELECT NOW() n1, SLEEP(2), NOW() n2
-> 2006-04-12 13:47:36 # n1
-> 2006-04-12 13:47:36 # n2
SELECT SYSDATE() s1, SLEEP(2), SYSDATE() s2
-> 2006-04-12 13:47:36 # s1
-> 2006-04-12 13:47:38 # s2
Questions and answers:
Clink on Option to Answer
1. Get current date
- a) SELECT {{CURRENT_DATE}}();
- b) SELECT {{DATE}}();
2. When s2 is +2 seconds?
- a) SELECT NOW() n1, {{SLEEP(2)}}, NOW() n2;
- b) SELECT SYSDATE() s1, {{SLEEP(2)}}, SYSDATE() s2;