回答編集履歴

1

追記

2021/10/04 11:55

投稿

yambejp
yambejp

スコア116724

test CHANGED
@@ -81,3 +81,47 @@
81
81
  )
82
82
 
83
83
  ```
84
+
85
+ 削除じゃないタイプ
86
+
87
+ ```SQL
88
+
89
+ select * from tbl where col1 in(
90
+
91
+ select col1
92
+
93
+ from (
94
+
95
+ select col1,group_concat(concat(col2,'_'),concat(col3,'_'),col4 order by col2,col3,col4 separator ':') as val
96
+
97
+ from tbl
98
+
99
+ group by col1
100
+
101
+ ) as t1
102
+
103
+
104
+
105
+ having (select count(*)+1 from (select *
106
+
107
+ from (
108
+
109
+ select col1,group_concat(concat(col2,'_'),concat(col3,'_'),col4 order by col2,col3,col4 separator ':') as val
110
+
111
+ from tbl
112
+
113
+ group by col1
114
+
115
+ ) as t2
116
+
117
+ ) as t3
118
+
119
+ where col1<t1.col1
120
+
121
+ and val=t1.val
122
+
123
+ ) =1
124
+
125
+ )
126
+
127
+ ```