phoenix - How to use WHERE clause with Phoenix UPSERT
问题描述
Looks like UPSERT doesn't support a WHERE clause.
But people have used workaround like following:
UPSERT INTO test.MyTable(col1, col2) SELECT col3, col4 FROM test.TempTable WHERE col5 = ABC
Does that mean if I have a use case where I need to update all the columns of the MyTable
based on some key, I need to add the data to be updated in another TempTable
then use a command similar to above to update data of the MyTable
. Please let me know if my understanding is correct. Somehow adding data in another table just to update source table does not seems correct.
解决方案
推荐阅读
- vmware - 使用 powercli (powershell) 重命名快照 vmware 的说明
- mysql - 数据库查询中的拆分字段
- android-studio - Android Studio 3.1.2 打开项目后挂起
- polymer - 声明式定义的属性值在 Polymer LitElement 中不起作用
- c# - 重载一个对象出错的类?
- android - 对于约束布局android,屏障没有按预期运行
- node.js - while循环代码没有在节点js中按顺序执行
- javascript - React JS 外部超链接到 html 文件
- javascript - How to change color of letter on mouse hover in JavaScript
- perl - Perl find - 返回内存不足