Comments (4)
Hello.
Probably UPSERT can help with your task. https://ydb.tech/en/docs/yql/reference/syntax/upsert_into
from ydb.
Hello. Probably UPSERT can help with your task. https://ydb.tech/en/docs/yql/reference/syntax/upsert_into
No, it can't.
UPSERT INTO users(id, phone, sms_code, sms_code_expiration)
VALUES (?id, ?phone, ?sms_code, ?sms_code_expiration);
will update id
column of row, but I need to do this only if row doesn't exist.
from ydb.
UPSERT INTO users(id, phone, sms_code, sms_code_expiration) VALUES (?id, ?phone, ?sms_code, ?sms_code_expiration);
will update
id
column of row, but I need to do this only if row doesn't exist.
Technically, updating id with the same value leads to just updating values. To my mind result would be the same, either you callINSERT INTO ... ON DUPLICATE KEY <update all fields>
orUPSERT ... <specify all fields>
. Do you see any controversial example?
from ydb.
INSERT INTO table1 (id, value, create_time)
VALUES ($id, $value, $create_time)
ON DUPLICATE KEY
UPDATE value = $value;
but UPSERT will modify create_time too.
from ydb.
Related Issues (20)
- Redefine `ToString()` for `TEvSchemeShard::TEvDescribeSchemeResult`
- Temporary directories remain after backup
- Fix a bug where CBO always picks a Lookup join if its applicable HOT 1
- Compute correct statistics for explain plan with Lookup Joins HOT 1
- [QueryService] Cannot update multiply tables in one transaction HOT 1
- Support CopySequence in schemeshard
- [pg] YQL function for create PG value from oid and string
- Fix incorrectly finished/incorrectly overwritten spans in grpc request proxy
- Stable host for metrics
- [Configs Validation] Add cli command for validating candidate config vs current config HOT 1
- [pg] Native and prepared queries slower, then text query over pgwire
- Build index operation blocks table in some cases HOT 1
- Return log size in PDisk data
- Add PDiskId filter to `viewer/json/storage`
- Backup/Restore fails on UUID columns
- TExecuteDistributedEraseTxUnit: VERIFY failed HOT 1
- Support returning list in yql v1 HOT 1
- Jepsen: multiple conflicting appends sometimes succeed HOT 5
- secure potentialy fatal operations in hive monitoring
- Node freeze should still work when the node restarts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ydb.