db_update() with joins Is there any way to db_update() for the following query? 

UPDATE field_data_field_TEST as ft 
left join node as n on ft.entity_id = n.nid
set n.type='test'
where n.type='foo'


I tried using db_update()-&gt;join(); but it didn't work.
db_update() doesn't implement any interfaces that have join()/innerJoin()/etc. methods so I think you're stuck with using db_query() and writing the query string out manually.

$sql = "
  UPDATE field_data_field_TEST as ft 
  left join node as n on ft.entity_id = n.nid
  set n.type = :type1
  where n.type = :type2";

$args = array(':type1' =&gt; 'test', ':type2' =&gt; 'foo');
db_query($sql, $args);