This article consists of three parts, collecting several methods for processing MSSQL datetime on the Internet. Here, we will sort the data according to my collection order.
Part 1: SQL statistics for this month and this weekStatistics for this
Insert the current time in MYSQL, just like GETDATE () of SQLSERVER. (See the previous section)-database-related-P. The NOW () function returns the current DATETIME with 'yyyy-MM-DDHH: MM: SS, which can be saved directly to the DATETIME field.
MYSQL common commands
Summary: mysql operations are commonly used for addition, deletion, modification, and query. MYSQL operations are a complete solution -- SQL killer
MYSQL operations-SQL killer code:
-- ================================ Simple
Common SQL example: knowledge required for database development bitsCN.com -- View all data in the student table
Select * from studio
-- Insert a new student information
Insert into studio (st_name, st_sex, st_age, st_add, st_tel) values ("Huang
Recently in the writing of some interfaces, summed up some of the points to be aware of the current thought, that is not the difference between SQL Server and other database statements, just think about the written down, the usual after the thought
Differences between MySQL and SQL Server
1. mysql supports enum, set, and SQL server.2. mysql does not support nchar, nvarchar, and ntext3. the incremental Statement of mysql is AUTO_INCREMENT, while that of mssql is identity)4. mssql by default,
1 MySQL supports enum, and set type, SQL Server does not support
2 MySQL does not support nchar,nvarchar,ntext type
3 The incremental statement of MySQL is auto_increment, while MSSQL is identity (1,1)
4 MSMs default values for the table creation
ORACLE:
Familiar with system time: Select sysdate from dual time type acquisition;
Select to_char (sysdate, 'yyyy-mm-dd hh24: MI: ss') from dual; obtained in string formDB2:
Select current timestamp from sysibm. sysdummy1 get system
In mysql, we often use the CONVERT () function to format the time and date of the CONVERT type. below I will introduce you to the usage of the CONVERT () function in detail, for your reference.
In mysql, we often use the CONVERT () function to
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.