Love to live, and live to love

When it can be simple, keep it simple. When it can’t, make it simple!

Update table from the other field of the same table

Posted by ardnahc pada 19 Juni, 2014

hell yeah.. got some tips from stackoverflow about how to update record from the other record from the same table. here is my code:


update `tblname` as dudul, (select id,record2 from `air` where record3=’2014-06′) AS dudul2
set dudul.record1 = dudul2.record2
where dudul.record3=’2014-07′ and;


thanks so.



Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )


Connecting to %s

%d blogger menyukai ini: