Guest User

Untitled

a guest
Aug 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. update a column of the first 5000 rows of a table in MYSQL version 5.1.11
  2. update clientdetails set lastupdateddate=now where id in (Select id from clientdetails limit 1,5000);
  3.  
  4. update clientdetails set lastupdateddate=now where <your where clause>
  5. limit <desired limit>;
  6.  
  7. SELECT * FROM table1 WHERE foo IN (SELECT foo FROM table2 LIMIT 50)
  8.  
  9. SELECT *
  10. FROM table1 t
  11. JOIN (SELECT foo FROM table2 LIMIT 50) as tmp
  12. ON tmp.foo = t.foo;
  13.  
  14. UPDATE clientdetails
  15. SET lastupdateddate = NOW()
  16. ORDER BY id
  17. LIMIT 0, 5000;
Add Comment
Please, Sign In to add comment