[Oracle] UPDATE FROM: implement correlated update support
See original GitHub issueHi!
I think Oracle has more good candidate for such thing:
UPDATE
[UpdatedEntities]
SET
( [Value1], [Value2], [Value3] ) =
(
SELECT
([UpdatedEntities].[Value1] * [t].[Value1]) * @int1,
([UpdatedEntities].[Value2] * [t].[Value2]) * @int2,
([UpdatedEntities].[Value3] * [t].[Value3]) * @int3
FROM
[NewEntities] [t]
WHERE
[t].[id] <> @someId AND [UpdatedEntities].[id] = [t].[id]
)
WHERE
EXISTS(
SELECT
*
FROM
[NewEntities] [t6]
WHERE
[t6].[id] <> @someId AND [UpdatedEntities].[id] = [t6].[id]
)
_Originally posted by @AndrePScope in https://github.com/linq2db/linq2db/pull/1278#issuecomment-620851672_
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Oracle SQL correlated update
Now what I want is to update t1.c with t3.d. But I can't just update t1 from t3 using t1.c = t3.c I...
Read more >Update statement with correlated subquery that intentionally...
I am trying to update one table using a subquery that totals several transactions from another table. I cannot figure how to link...
Read more >5 Ways to Update Data with a Subquery in Oracle SQL
Another way to use a subquery in an UPDATE statement is to use a correlated subquery. It works in a similar way to...
Read more >4 ways to do multiple table update in Oracle (what works ...
Cross table update (also known as correlated update, or multiple table update) in Oracle uses non-standard SQL syntax format (non ANSI standard) to...
Read more >Updates Based on Queries
Updates Based on Queries. This article describes how a table can be updated using data from another table. Setup; Subquery Method; Inline View ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@viceroypenguin. Oracle is the rule-breaker, WITH statements in such case will not work. Oracle sticks WITH statement with SELECT, not whole query.
@sdanyliv tangentially related: is there a syntax to write a “tuple” (not sure what’s the right word) update in Oracle manually?
I.e. can you write this with linq2db?