Guest User

Untitled

a guest
Mar 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. update table1 as t1,table2 as t2 set t1.field1=t2.field2 where t1.uid=t2.uid;
  2.  
  3. $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
  4. ->getQueryBuilderForTable('table1');
  5. $queryBuilder->getRestrictions()
  6. ->removeAll();
  7. $queryBuilder->update('table1')
  8. ->join('table1', 'table2', 't2',
  9. $queryBuilder->expr()->eq(
  10. 't2.uid',
  11. $queryBuilder->quoteIdentifier('table1.uid')))
  12. ->set(
  13. 'table1.field1',
  14. $queryBuilder->quoteIdentifier(
  15. 't2.field2'),
  16. false
  17. )->execute();
Add Comment
Please, Sign In to add comment