Decimal (numeric) synonymous for precise storage of numeric valuesfloat and real cannot store values accuratelyThe decimal data type can store up to 38 digits, and all numbers can be placed to the right of the decimal point. The decimal data type
Use sum (SUM) FunctionThe sum function is used to return the sum of all values in the expression. This function is usually used to summarize some data.
Syntax:
Sum ([All | distinct] expression)
Parameter description:
L all: Performs aggregate
SQL Server float uncertainty
Most of the time, we all know that the floating point storage is an uncertain value, and you will never know whether it is something like 0 = 0.00000000000000123 or 0 = 0.00000000000999. There may be no problems at the
The original planning number field is text. Format without changing the type
SUM (CAST (number As Integer))
Instance code:
The code is as follows
Copy Code
Msql= "Select SUM (CAST (field name as Integer)" from table
Decimal () indicates that the decimal point is 14, and the decimal point is 4. the decimal point includes all valid digits, including the decimal point, the number before the decimal point, and the number after the decimal point.
Decimal (numeric)
MS SQL Server Query optimization methodThere are many reasons for the slow speed of queries, which are common1, no indexes, or no indexes (this is the most common problem with query slowness, is the flaw in programming)2, I/o throughput is small,
Due to the previous period of stomach pain, the blog Park blog has been stopped more than one months or so. In recent days, stomach trouble finally slightly improved, decided to re-write blog post.A few days ago, a friend just asked me about the SQL
You have not met in SQL 1 is not equal to 1 (1<>1) situation!? Here's an example to illustrate the situation.Let's start with a brief introduction to the four numeric data types in the header.In T-SQL, numeric and decimal are exact numeric data
SQL statement optimization improves database performance and SQL statement database performance
In systems with unsatisfactory performance, apart from the fact that the application load exceeds the server's actual processing capacity, it is more
A decimal data type can store up to 38 numbers. All numbers can be placed on the right of the decimal point. The decimal data type stores an accurate (accurate) numeric expression, and does not store approximate values. Two features of defining
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.