我有这张桌子
A B
1 1H
2 1H
1 1G
1 1E
我需要更新此表的列A,该列将max(a)分组为B,其count(*)=2。
结果将如下所示:
A B
2 1H
2 1H
1 1G
1 1E
答案 0 :(得分:0)
也许吗?
update tablename t1
set A = (select max(A) from tablename t2 where t2.B = t1.B)
where B in (select B from tablename group by B having count(*) >= 2)
答案 1 :(得分:0)
您可以在下面尝试
app:layout_constrainedHeight="true"