当前位置:网站首页>PgSQL converts string to double type (to_number())
PgSQL converts string to double type (to_number())
2022-07-03 07:22:00 【Maple Leaf pear flower】
Today I write sql When , Find out PG There is a table in which the area field is set to string type , In this way, statistics cannot be used sum Function , So you need to convert the string to double Add the types .
select sum(to_number(mj,9999.99)) as amountmj from table group by areaamong 9999.99 It doesn't matter mj The value of the field is still amountmj The value of cannot exceed 9999.99, And keep two decimal places .
边栏推荐
- Custom generic structure
- C code production YUV420 planar format file
- Recursion, Fibonacci sequence
- 20220319
- sharepoint 2007 versions
- "Moss ma not found" solution
- [set theory] order relation (partial order relation | partial order set | example of partial order set)
- [most detailed] latest and complete redis interview book (50)
- Advanced API (byte stream & buffer stream)
- Use of file class
猜你喜欢

The embodiment of generics in inheritance and wildcards

Map interface and method

IPv4 address

VMWare网络模式-桥接,Host-Only,NAT网络

Hash table, generic

Take you through the whole process and comprehensively understand the software accidents that belong to testing

Interview questions about producers and consumers (important)

Circuit, packet and message exchange

Specified interval inversion in the linked list

Basic components and intermediate components
随机推荐
Common problems in io streams
带你全流程,全方位的了解属于测试的软件事故
10 000 volumes - Guide de l'investisseur en valeur [l'éducation d'un investisseur en valeur]
Jeecg data button permission settings
Common architectures of IO streams
gstreamer ffmpeg avdec解码数据流向分析
Wireshark software usage
Deep learning parameter initialization (I) Xavier initialization with code
你开发数据API最快多长时间?我1分钟就足够了
IO stream system and FileReader, filewriter
[most detailed] latest and complete redis interview book (50)
VMware virtual machine installation
TreeMap
PdfWriter. GetInstance throws system Nullreferenceexception [en] pdfwriter GetInstance throws System. NullRef
TCP cumulative acknowledgement and window value update
Advanced API (UDP connection & map set & collection set)
Advanced API (character stream & net for beginners)
Custom generic structure
TypeScript let与var的区别
Advanced API (local simulation download file)