当前位置:网站首页>SQL, CTE, FLG CASE问题
SQL, CTE, FLG CASE问题
2022-06-25 03:45:00 【CSDN问答】
求问大家一个SQL问题!我想求GROUP A-B的部分,并标记FLG为‘0’,Group B 为‘1’。已知GROUP A是520, GROUP B是5。FLG为‘0’则是515,但我还是得出520.大家能看下我的code吗?看是可能哪里出问题了,谢谢!
With PreMatricCTE as
(
SELECT DISTINCT
ID
,CASE
WHEN
(Group B的where) then 1 else end as CompletedFLG
FROM GROUP A
INNER JOIN GROUP B on A.ID = B.ID
GROUP BY ID
)
SELECT DISTINCT
ID
, MAX (CompletedFLG) as CompletedFLG
FROM PreMatricCTE
WHERE CompletedFLG = '0'
GROUOP BY ID
边栏推荐
- Development of trading system (XII) - Official quickfix document
- Development of trading system (I) -- Introduction to trading system
- 如何使用IDE自动签名调试鸿蒙应用
- 2.吹响半音阶口琴
- What is the difference between learning code, rolling code and fixed code? The number of repeated codes, coding capacity and the principle of rolling code
- Development of trading system (III) - risk control system
- OpenSUSE environment variable settings
- Musk was sued for $258billion in MLM claims. TSMC announced the 2nm process. The Chinese Academy of Sciences found that the lunar soil contained water in the form of hydroxyl. Today, more big news is
- JS tool function, self encapsulating a throttling function
- 【Proteus仿真】Arduino UNO按键控制数码管闪烁增/减显示
猜你喜欢

Crawler crawls Sina Weibo data

Maintenant, les oreilles vont entrer dans le métacosme.

opencv是开源的吗?

完美洗牌问题
![[team learning] SQL programming language notes - task04](/img/3e/c75f5b4610c6b6700567fe75cd2339.png)
[team learning] SQL programming language notes - task04

How to use ide to automatically sign and debug Hongmeng application

zabbix的安装避坑指南

Google founder brin's second marriage broke up: it was revealed that he had filed for divorce from his Chinese wife in January, and his current fortune is $631.4 billion

居家办公之后才明白的时间管理 | 社区征文

ZABBIX installation pit avoidance Guide
随机推荐
Development of trading system (I) -- Introduction to trading system
PHP代码审计1—PHP.ini的那些事
【Rust投稿】从零实现消息中间件(6)-CLIENT
微信小程序中的列表渲染
Dr. Sun Jian was commemorated at the CVPR conference. The best student thesis was awarded to Tongji Ali. Lifeifei won the huangxutao Memorial Award
Development of trading system (II) -- market data
Sun Wu plays Warcraft? There is a picture and a truth
Preparedstatement principle of preventing SQL injection
opencv是开源的吗?
Jilin University 22 spring March "official document writing" assignment assessment-00084
代錶多樣性的彩色 NFT 系列上線 The Sandbox 市場平臺
Jilin University 22 spring March document retrieval assignment assessment-00073
Maybe it's the wrong reason
JSP cannot be resolved to a type error reporting solution
Create SQLite table with shell script and add SQL statement -- General
Hello CTP (IV) - CTP transaction API
Wechat development related
Comprehensive assignment of thesis writing instruction of Dongcai
Development of trading system (VIII) -- Construction of low delay network
Jilin University 22 spring March "career design" assignment assessment-00072