ClickHouse:输出 INSERT INTO ... SELECT 的插入行
当执行直接插入SELECT
查询的结果行的INSERT INTO ... SELECT ...
语句时,有没有办法输出这些新插入的行?
一些研究表明,例如 SQL Server 有一个用于 INSERT
的 OUTPUT
子句来实现此目的,但我找不到与 ClickHouse 类似的东西。
目的是避免必须通过我们的客户端应用程序发送两个单独的查询。
When executing a INSERT INTO ... SELECT ...
statement that directly inserts the resulting rows of the SELECT
query, is there any way to output these newly inserted rows?
Some research shows that for example SQL Server has an OUTPUT
clause for INSERT
to achieve this, but I couldn't find anything similar with ClickHouse.
The intention is to avoid having to send two separate queries via our client application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为部分解决方案,您可以尝试将
task_id LowCardinality(String)
添加到目标表中之后,在应用程序端生成
task_id
值并使用两个单独的查询As partial solution, you can try to add
task_id LowCardinality(String)
into your destination tableafter it, generate
task_id
value on your application side and use two separate queries