In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains how to solve the problem of "how to solve the problem that the result of SQL division in MSSQL is a decimal but shows 0". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. please follow Xiaobian's train of thought to slowly deepen together to study and learn how to solve the problem that the result of SQL division in MSSQL is a decimal number but shows zero.
Today, in the SQL division operation with MSSQL, it is found that the result has decimals, but when the integer part is 0, the result is directly displayed as 0. After a flip test, the solution is found and shared.
Suppose you have the following SQL division operation:
Select field1/field2 from table
Assuming that the result of the operation should be 0.123, but the actual operation is directly displayed as 0 in the MSSQL query Editor, is there any way to show the real result? The method is to cast the data type of the molecular field1 to float, as follows:
Select cast (field1 as float) / field2 from table
Thank you for your reading, the above is the content of "how to solve the problem that the result of SQL division operation in MSSQL is decimal but shows 0". After the study of this article, I believe you have a more profound understanding of how to solve the problem of how to solve the problem that the result of SQL division operation is decimal but shows zero in MSSQL. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.