mysql 查詢其他表做update

這只是一篇文記,我不打算詳細說明
主要功能就是把某一個表的資料參照過來做更新

UPDATE file_record
SET tid =    (select cdb_posts.tid from cdb_posts where cdb_posts.pid=file_record.pid)
WHERE EXISTS (select cdb_posts.tid from cdb_posts where cdb_posts.pid=file_record.pid);

沒有回應 »

作者:Benson 於 2009年11月03日 文章分類:學習筆記 文章標籤:,

相關文章


隨機文章

文章讀取...

Trackback URI | Comments RSS

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word