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)
- [[new IAM integration]]
- [[OpenSource]] Updating YDB canonical data in Github HOT 3
- NoTx mode in cli
- enable graphshard by default
- extract range produces implicit limit on number of rows to read (even in scan query)
- ydb crashes with the `LISTFROMRANGE` function HOT 1
- ydb crashes with the `EVALUATEEXPR` function HOT 1
- [pg] ydb crashes via pgclient with the `JSON_ARRAY_ELEMENTS` function HOT 2
- [pg] ydb crashes via pgclient with the `NEXTVAL` function HOT 2
- It is not obvious that all Date and Time types couldn't be more than the year 2105 from the documentation
- Flapping 503 discovery error from mvp-meta
- Coordinator: broken Coordinator/MissingConfig counter
- Coredump в KQP HOT 2
- parallel sink writes
- CalculateKeyBytes operator precedence fix HOT 1
- [bug]: parallel call http endpoint `/actors/kqp_proxy?force_shutdown=all` with the number of sessions > 1 will kill the database
- [[Newbius monitoring]] console user graphics
- docs: describe restrictions on scheme names
- docs: describe restrictions on names of the columns, indexes etc.
- Build size statistics
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.