Αποτελέσματα Αναζήτησης
15 Μαρ 2010 · You can do this: UPDATE table1 SET table1.value = (SELECT table2.CODE. FROM table2 . WHERE table1.value = table2.DESC) WHERE table1.UPDATETYPE='blah'
Here is an example: UPDATE items,month SET items.price=month.price WHERE items.id=month.id; The preceding example shows an inner join that uses the comma operator, but multiple-table UPDATE statements can use any type of join permitted in SELECT statements, such as LEFT JOIN.
This tutorial shows you how to perform cross-table updates by using the MySQL UPDATE JOIN statement with the INNER JOIN or LEFT JOIN clause.
19 Φεβ 2015 · For example: UPDATE CONTACT C SET (C.PHONE, C.FAX) = ( SELECT P.PHONE, P.FAX FROM PERSON P WHERE P.PERSON_ID = C.PERSON_ID ) WHERE C.CURRENT_YEAR_ID = ( SELECT CURRENT_YEAR_ID FROM CURRENT_YEAR WHERE DEFAULT_YEAR = 1 ); (You'll have to check my logic, because I'm not entirely clear on your relationships.)
update flights f1 set f1.departure_datetime = timestamp'2015-01-01 11:00:00 -00:00', (f1.flight_number, f1.flight_duration) = ( select f2.flight_number || '0', f2.flight_duration from flights f2 where f2.departure_airport_code = f1.departure_airport_code and f2.destination_airport_code = f1.destination_airport_code and trunc(f2.departure ...
6 Σεπ 2021 · An example of when you might want to perform an UPDATE statement with a JOIN. Writing your UPDATE statement as a SELECT statement first. The general syntax of writing an UPDATE statement with a JOIN. Converting your SELECT statement to an UPDATE statement. Tips and tricks.
9 Ιαν 2024 · MySQL UPDATE with JOIN allows you to update a table based on data from another table or tables. You can join multiple tables using the JOIN keyword and use the SET clause to specify the columns to update and the values to set.