The most difficult part when working with dates is to be sure that the format of the date you are trying to insert, matches the format of the date column in the database. As long as your data contains only the date portion, your queries will work as expected. However, if a time portion is […]
Category: Database
The database is a warehouse that organizes, stores and manages data according to the data structure. It was created more than 60 years ago. With the development of information technology and the market, especially after the 1990s, data management is no longer just It is to store and manage data, and transform it into various data management methods required by users. There are many types of databases, from the simplest tables that store various data to large-scale database systems that can store massive amounts of data. They have been widely used in all aspects.
MySql AUTO INCREMENT Field
If you accidentally lose the primary key and need to modify the id column of the table as the primary key, you can use the following SQL statement
Mysql delete duplicate records and only keep one row
Recently, I have been working for a subject storehouse system. Since duplicate subject are added to the storehouse, it is necessary to query the duplicate subject, and delete all duplicate subject leave only one, so that the duplicate subject cannot be taken when the test is taken. First wrote a small example: Single field operation […]
Mysql deadlock, waiting for resources, transaction lock, lock wait timeout exceeded; try restarting transaction
Mysql deadlock, waiting for resources, transaction lock, lock wait timeout exceeded; try restarting transaction I have already learned about InnoDB. When the lock wait occurs, it will judge whether the timeout operation is needed according to the configuration of the parameter innodb_lock_wait_timeout. This document describes the viewing and analysis processing when the lock wait occurs. […]
Mybatis annotation application mapping statement
MyBatis provides a variety of annotation mappings such as SELECT, UPDATE, INSERT, and DELETE. Let me take a closer look at the application of these mappings. 1.@Insert We can use the @Insert annotation to declare an INSERT mapping. Package com.owen.mybatis.mappers; Public interface StudentMapper { @Insert(“INSERT INTO STUDENTS(STUD_ID, NAME, EMAIL, ADDR_ID, PHONE) VALUES(#{studId},#{name},#{email},#{address.addrId},#{phone})”) Int insertStudent(Student student); […]