![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there anyway to update the FLAG field with using a Where clause using bits of 2 tables? |
#3
| |||
| |||
|
|
[UPDATE with FROM clause] it's very standard SQL (not that that means anything to Oracle). |
|
JOINS should never be done in the WHERE clause. That's an archaic construction. They should be done using the appropriate JOIN syntax; |
|
.. but it isn't logical to write Value = COLUMN. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
[UPDATE with FROM clause] it's very standard SQL (not that that means anything to Oracle). Notice that no correlation name is allowed in the UPDATE clause; this is to avoid some self-referencing problems that could occur. But it also follows the data model in Standard SQL. When you give a table expression a correlation name, it is to act as if a materialized table with that correlation name has been created in the database. That table then is dropped at the end of the statement. If you allowed correlation names in the UPDATE clause, you would be updating the materialized table, which would then disappear and leave the base table untouched. |
#6
| |||
| |||
|
|
What do you mean that no correlation name is allowed? You can place a table name (correlation) label on an update, otherwise how |
#7
| |||
| |||
|
|
What do you mean that no correlation name is allowed? You can place a table name (correlation) label on an update, otherwise how would you perform co-ordingated subqueries? (Code runs on Oracle 7.0 - 9.2) NOT in Standard SQL; look it up! "Caesar: Pardon him, Theodotus. He is a barbarian and thinks the customs of his tribe and island are the laws of nature." - Caesar and Cleopatra; George Bernard Shaw 1898 It would make no sense. The ANSI/ISO model is that a correlation creates a temporaty working table with that name and the data of the table expression on the left hand side of the AS operator. You also have the option of renaming the columns in the new table. This means that the working table, not the base table, would be updated and then disappear. |
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |