This topic is locked

SQL code help

7/19/2017 10:40:50 AM
PHPRunner General questions
T
tubisan author

hi

SQL code help

Update the existing table field according to the value of a different table
---------------------

SELECT

daire.id,

daire.blok,

daire.daire_no,

daire.daire_tipi,

daire.dairem2,

daire.blok_adi,

daire.dolu,

(UPDATE daire SET daire.dolu='1' WHERE sakinler.aktif='1')

FROM daire

, sakinler

admin 7/19/2017

You cannot do select and update in the same query. If you are looking for an update that uses values from another table check examples here:

https://stackoverflow.com/questions/1262786/mysql-update-query-based-on-select-query