Selectsubdate (Curdate (), Date_format (Curdate (), '%w ')-1)//Get current date in the Monday of the weekSelectsubdate (Curdate (), Date_format (Curdate (), '%w ')-7)//Get current date on Sunday of the weekThese two sentences are a method that MySQL
pick up time : Select Current_timestamp;output: 2016-06-16 16:12:52Select Now ();output:2016-06-16 16:12:52 Select Subdate (now (), Interval-second);output:2016-06-16 16:11:52 Take the next minute of the current time :Select Adddate (now (),
DAYOFWEEK (date)The return date is the day of the week (1= Sunday, 2 = Monday,...... 7= Saturday, ODBC Standard)Mysql> Select DAYOFWEEK (' 1998-02-03 ');3WEEKDAY (date)The return date is the day of the week (0= Monday, 1 = Tuesday,...... 6=
MySQL time function, put the view1. The first day of the week, starting from Sunday mysql> select DayOfWeek (' 2015-05-25 '); +-------------------------+| DayOfWeek (' 2015-05-25 ') |+-------------------------+| 2 |+------------
Count the number of access pages and rank them in resolutionSELECT CONCAT (' height ', ' * ', ' width ') as ' resolution ', COUNT (CONCAT (' height ', ' * ', ' width ')) as ' total ' from ' Wifi_statu S_page ' GROUP by CONCAT (' height ', ' * ', '
Date_add application Scenarios in MySQL/* Current time plus 1 milliseconds */SELECT Date_add (now (), INTERVAL 1 microsecond);/* Current time minus 1 milliseconds */SELECT Date_add (now (), INTERVAL-1 microsecond);/* Current time plus 1 seconds
1.1 Get the current date + time (date + times) function: Now ()In addition to the now () function to get the current datetime, MySQL has the following function:Current_timestamp () Current_timestampLocalTime () localtimeLocaltimestamp ()
1.1 Get the current date + time (date + times) function: Now ()In addition to the now () function to get the current datetime, MySQL has the following function:Current_timestamp () Current_timestampLocalTime () localtimeLocaltimestamp ()
For the description of the valid format of the value range of each type and the specified date and time value, see 7.3.6 Date and Time type.
For the description of the valid format of the value range of each type and the specified date and time
I. date and Time Functions DAYOFWEEK (date) return the date of the Week (1 Sunday, 2 Monday ,...... 7 Saturday, ODBC standard) WEEKDAY (date) returns the date of the Week (0 Monday, 1 Tuesday ,...... 6 Sunday ). MONTH (date) returns the number of
For the description of the valid format of the value range of each type and the specified date and time value, see 7.3.6 Date and Time type.Here is an example of using the date function. The following query Selects all records. The value of date_col
MySql calculates every day, every hour, every minute, and every minute in a period of time.
Statistics on each day in a period of time or at each time point are usually calculated. However, mysql itself does not directly obtain the time point list
For the description of the valid format of the value range of each type and the specified date and time value, see 7.3.6 date and time type. Here is an example of using the date function. The following query selects all records. The value of
Mysql Technology Insider-notes-Chapter 2 data types
Chapter 2 data types
Do not use UNSIGNED in Mysql as it may bring unexpected results.
Show create table tablename/G; view the TABLE creation statement
ZEROFILL will automatically
MySQL functions and Usage examples
String functions
ASCII (str)Returns the ASCII value of the first character of the string 'str' (0 is returned when 'str' is an empty string)Mysql> select ASCII ('2 ');-> 50Mysql> select ASCII (2 );-> 50Mysql>
Summary of MySQL date and time functions bitsCN.com
Mysql database date and time functions, mysql function Daquan, summary record, for later use.
DAYOFWEEK (date)The return date is the day of the week (1 = Sunday, 2 = Monday ,...... 7 = Saturday,
MySQL date functions and date conversion formatting functions, mysql Functions
Mysql is a free relational database with a huge user base. This article lists MYSQL common date functions and date conversion formatting functions.
1. DAYOFWEEK
Here is an example of using the date function. The following query Selects all records, and its date_col is within the last 30 days: mysqlSELECTsomethingFROMtableWHERETO_DAYS (NOW ())
Here is an example of using the date function. The following
For operations on the string position, the first position is marked as 1.ASCII (str)Returns the ASCII code value of the leftmost character of the str string. If str is a Null String, 0 is returned. If 'str' is NULL, return NULL.Mysql> select ASCII ('
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.