当前位置:网站首页>SQL, CTE, flg case problems
SQL, CTE, flg case problems
2022-06-25 04:12:00 【CSDN Q & A】
Ask everyone one SQL problem ! I want to ask GROUP A-B Part of , Tagged FLG by ‘0’,Group B by ‘1’. It is known that GROUP A yes 520, GROUP B yes 5.FLG by ‘0’ It is 515, But I still get 520. You can have a look at my code Do you ? Maybe something is wrong , thank you !
With PreMatricCTE as
(
SELECT DISTINCT
ID
,CASE
WHEN
(Group B Of 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
边栏推荐
- "How to carry out industrial positioning" in local / Park industrial planning
- 【Harmony OS】【ARK UI】ETS 上下文基本操作
- OpenSUSE environment variable settings
- 1. first knowledge of chromatic harmonica
- Simple integration of client go gin 11 delete
- web3.eth. Getpendingtransactions() returns null?
- 代錶多樣性的彩色 NFT 系列上線 The Sandbox 市場平臺
- Cesium graphic annotation circle, square, polygon, ellipse, etc
- 升级cmake
- [harmony OS] [ark UI] basic ETS context operations
猜你喜欢
Flutter FittedBox组件
[rust submission] review impl trail and dyn trail in rust
Development of trading system (VIII) -- Construction of low delay network
How to quickly deliver high-value software
Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment
"Comment positionner l'industrie" dans la planification industrielle locale / parc
Development of trading system (VII) -- Analysis of trading delay
【Proteus仿真】Arduino UNO按键控制数码管闪烁增/减显示
《悉达多》:一生之书,可以时常反刍
95% 程序员都在这里摸鱼……
随机推荐
Qt编译数据库插件通用步骤说明
Cesium drag 3D model
BGP biplane architecture
Jilin University 22 spring March new development English comprehensive course (I) assignment assessment-00080
[harmony OS] [arkui] ETS development graphics and animation drawing
1.初识半音阶口琴
墨天轮访谈 | IvorySQL王志斌—IvorySQL,一个基于PostgreSQL的兼容Oracle的开源数据库
MySQL modifies and deletes tables in batches according to the table prefix
AI quantitative transaction (I) -- Introduction to quantitative transaction
升级cmake
Development of trading system (XI) -- Introduction to quickfix
acmStreamOpen返回值问题
Vigilance against over range collection of privacy - ten mobile app violations
client-go gin的简单整合十-Update
How to use ide to automatically sign and debug Hongmeng application
Cesium loading display thermal diagram
Jilin University 22 spring March "official document writing" assignment assessment-00029
数学分析_笔记_第3章:极限
Cesium 加载显示热力图
PHP code audit 1 - php Ini