当前位置:网站首页>SQL server2005中SUM函数中条件筛选(IF)语法报错
SQL server2005中SUM函数中条件筛选(IF)语法报错
2022-06-30 03:50:00 【CSDN问答】
问题遇到的现象和发生背景
SQL server2005中SUM函数中条件筛选(IF)语法报错
问题相关代码,请勿粘贴截图
select SUM(IF(counts>0,counts,0) from testTable
运行结果及报错内容
报错信息:
消息 156,级别 15,状态 1,第 1 行
关键字 'IF' 附近有语法错误。
消息 102,级别 15,状态 1,第 1 行
',' 附近有语法错误。
我的解答思路和尝试过的方法
麻烦大家帮我看看这个语法错再哪里
我想要达到的结果
想要在testTable表的counts列中筛选出所有大于0的值的总和
边栏推荐
- 【笔记】2022.5.23 MySQL
- 【云原生】AI云开发平台——AI Model Foundry介绍(开发者可免费体验AI训练模型)
- Chapter 2 control structure and function (programming problem)
- 解决navicat连接数据库遇到的问题
- Solutions for project paths
- Integrating viewbinding and viewholder with reflection
- Smart use of bitmap to achieve 100 million level massive data statistics
- SDS understanding in redis
- Semantic segmentation resources
- 如何利用FME 创建自己的功能软件
猜你喜欢

第十天 数据的保存与加载

(03). Net Maui actual combat basic control

GIS related data

【论文阅读|深读】Role2Vec:Role-Based Graph Embeddings

【笔记】2022.5.23 MySQL
![[note] on May 27, 2022, MySQL is operated through pychart](/img/34/36a3765683b2af485ca7c3e366da59.png)
[note] on May 27, 2022, MySQL is operated through pychart

The jupyter notebook kernel hangs up frequently and needs to be restarted

Interface testing -- how to analyze an interface?

C#【高级篇】 C# 多线程

第十一天 脚本与游戏AI
随机推荐
ReSharper 7. Can X be used with vs2013 preview? [off] - can resharper 7 x be used with VS2013 preview? [closed]
使用IDEAL连接数据库,运行出来了 结果显示一些警告,这部分怎么处理
[punch in - Blue Bridge Cup] day 5 --- lower() small
【作业】2022.5.28 将CSV写入数据库
Smart use of bitmap to achieve 100 million level massive data statistics
From 2500 a month, no one wants to go to the programming road of the technical director of a large factory | my ten years
Laravel9 installation locale
124 articles in total! Motianlun "high availability architecture" dry goods document sharing (including Oracle, mysql, PG)
. Net 7 JWT configuration is too convenient!
How to use FME to create your own functional software
Ubuntu20.04 PostgreSQL 14 installation configuration record
巧用 Bitmap 实现亿级海量数据统计
[punch in - Blue Bridge Cup] day 2 --- format output format, ASCII
SDS understanding in redis
Solve the problem of Navicat connecting to the database
如何利用FME 创建自己的功能软件
解决navicat连接数据库遇到的问题
matplotlib. pyplot. Hist parameter introduction
UML diagrams and list collections
Arrangement of language resources of upgraded version