NULL is involved in the computation result. It's still 0. Microsoft is really disgusting!

Source: Internet
Author: User

The implementation engineer said today that the total score of some items is 0, while that of some items is 5, 10, 10, 0, 19.8. The total score is 44.80.

It's always right to read data from other rows! Record the field name and the ID of the row, and reverse push back to lock a piece of code

 

Update A set Total = A + B + C + D + E + F;

 

Sum (datediff (MS, stdate, endate)/count (*) * 20

 

When this part of SQL statement Is run separately, it finds that the corresponding rows and columns are NULL. Then, it can be replaced with Is NULL (X, 0 ).

 

It is found that there are many blank enddate values, which leads to problems in all operation steps.

 

Sum (datediff (MS, stdate, isnull (enddate, getdate ()))

 

Since null values involved in the operation will cause all failures, I don't understand why do I need to set them like this? If NULL is encountered, why not ignore it?

The key IS that open personnel should use is null (X, 0) to check and judge the workload and company debugging time of the open personnel!

 

Microsoft is so disgusting!

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.