如何在 Derby 中模拟 UPDATE x SET (col1, col2) = ( SELECT a,b FROM y ) ?
Derby 不支持此语法:(
UPDATE x SET (col1, col2, ...) = ( SELECT a,b,... FROM y ... )
请参阅此错误)。 除了在 Java 中创建一个循环来进行选择并发送 N 个更新之外,还有其他解决方法吗?
[编辑] 请注意,我有 50 列和一个复杂的条件(与 x 和 EXISTS 等连接)。 所以我想避免重复 SELECT 50 次,请:)
Derby doesn't support this syntax:
UPDATE x SET (col1, col2, ...) = ( SELECT a,b,... FROM y ... )
(see this bug). Does anyone have a workaround other than creating a loop in Java which does the select and sends N updates back?
[EDIT] Note that I have 50 columns and a complex condition (joins with x and EXISTS and whatnot). So I'dd like to avoid repeating the SELECT 50 times, please :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也会这么做,rbobby siad,但我也是 MSSQL 人。
你有没有尝试过:
I too would do it the was rbobby siad but I'm also a MSSQL person.
Have you tried:
我不确定这是有效的sql(我更喜欢MS SQL,所以我可能还很遥远)。
通常我会这样做:
I'm not sure that's valid sql (I'm more a MS SQL guy so I could be way way off).
Normally I'd do: