Guest User

Untitled

a guest
Apr 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. create table ten(a int);
  2. insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
  3. create table t1 (a int, b int, c int, key(a));
  4. insert into t1 select a,a,a from ten;
  5. create table t2 as select * from t1;
  6. create table t3 as select * from t1;
  7.  
  8. set optimizer_switch='firstmatch=off';
  9.  
  10. update t1, t2 set t2.c=1000 where t1.a=t2.a and t1.b in (select b from t3 where t3.c<= t2.c) order by t2.c, t1.c limit 10;
Add Comment
Please, Sign In to add comment