-
In the MySQL field decimal(9,2), 9 is the fixed-point precision and 2 is the number of decimal places.
There is such a formula: decimal(a,b).
where a specifies the maximum number of decimal digits that can be stored to the left and right of the specified decimal point, with a maximum precision of 38;
b specifies the maximum number of decimal digits that can be stored to the right of the decimal point, and the number of decimal places must be a value between 0 and a.
Recognize the number of decimal places as 0.
MySQL is a relational database management system developed by MySQL AB in Sweden and is now part of Oracle. MySQL is one of the most popular relational database management systems, and when it comes to web applications, MySQL is the best RDBMS (Relational Database Management System) application.
-
Numeric and Decimal types are implemented by MySQL in the same type, which is allowed in the SQL92 standard. They are used to hold values that have important requirements for accurate accuracy, such as money-related data. When a column is declared with one of them, the precision and numerical range can (usually) be specified; For example:
salary decimal(5,2)
In this example, 5 (precision) represents the number of significant decimal digits, and 2 (scale) represents the number of digits after the decimal point. In this case, therefore, the salary column can store values ranging from to . (Actually, mysql can store values in this column all the way up to , because it doesn't store a sign for positive numbers).
decimal(9,2)
9 is the fixed-point precision and 2 is the number of decimal places.
decimal(a,b)
aSpecify the maximum number of decimal digits that can be stored to the left and right of the specified decimal point, with a maximum precision of 38.
bSpecifies the maximum number of decimal digits that can be stored to the right of the decimal point. The number of decimal places must be a value between 0 and a. The default number of decimal places is 0.
MySQL relational database management system is developed by MySQL AB in Sweden and currently belongs to Oracle. MySQL is one of the best RDBMS (Relational Database Management System) applications for web applications. MySQL is a relational database management system that keeps data in different tables instead of putting all the data in one large warehouse, which increases speed and flexibility.
The SQL language used by MySQL is the most commonly used standardized language used to access databases. MySQL software adopts a dual licensing policy, it is divided into community version and commercial version, due to its small size, fast speed, low total cost of ownership, especially the characteristics of open source, generally small and medium-sized developers choose MySQL as the database. Due to the excellent performance of the Community Edition, it can be used in combination with PHP and Apache to form a good development environment.
The SQL language used by MySQL is the most commonly used standardized language used to access databases.
-
decimal(9,2)
9 is the fixed-point precision, and BAY2 is the decimal du
Number of digits. decimal(a,b)
aSpecify the specified decimal point
The left and right sides can be answered with the maximum number of stored decimal digits with a maximum precision of 38.
bSpecifies the maximum number of decimal digits that can be stored to the right of the decimal point. The number of decimal places must be a value between 0 and a. The default number of decimal places is 0.
-
Indicates that the value of the field is null
Troubleshooting. Remove the redo log file you are currently using, and then you can try to start the database, but it fails! >>>More
After turning it on, there is no downtime, error or anything, and it will continue to be carried out.
Add the field status to varchar(10) in the database table
update database table name set status = from database table name inner join temporary table name b on database table name. qh = and database table name. tel = >>>More
You need to write a stored procedure that can do the above functionality! After all, what you're describing has a branching structure!
1. MySQL database has several configuration options that can help us capture inefficient SQL statements in a timely manner1, Slow Query Log >>>More