删除没有 min(rid) 的行
select min(q.rid)
from qvalues q
inner join batchinfo b
on q.rowid = b.rowid
and b.instrument = 'tf1'
group by q.rowid, q.name, q.compound
having count(*) > 1
- 我如何删除除 min(rid) 之外的所有内容,而不是选择 min(rid)?
- 我如何删除除 max(rid) 之外的所有内容?
请注意,我只想删除具有相同 rowid、名称和复合的值
select min(q.rid)
from qvalues q
inner join batchinfo b
on q.rowid = b.rowid
and b.instrument = 'tf1'
group by q.rowid, q.name, q.compound
having count(*) > 1
- instead of selecting the min(rid) how do i delete everything except for min(rid)?
- how do i delete everything except for max(rid)?
please note that i want to delete only values that have the same rowid, name, and compound
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要删除除 max 之外的所有内容,请使用 max 语法执行相同的操作
to delete all but max, you do the same with the max syntax