SHARE
TWEET

Untitled

a guest May 9th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE IF NOT EXISTS A ( ID INT, APROBADO TINYINT, REVISADO TINYINT );
  2. CREATE TABLE IF NOT EXISTS B ( ID INT, APROBADO TINYINT, REVISADO TINYINT );
  3. CREATE TABLE IF NOT EXISTS C ( ID INT, APROBADO TINYINT, REVISADO TINYINT );
  4.  
  5. INSERT INTO A VALUES
  6. (1,0,0),
  7. (2,0,1),
  8. (3,0,0),
  9. (4,0,1);
  10.  
  11. INSERT INTO B VALUES
  12. (10,0,0),
  13. (11,0,0),
  14. (12,0,1),
  15. (13,0,0);
  16.  
  17. INSERT INTO C VALUES
  18. (21,0,0),
  19. (22,0,0),
  20. (23,0,0),
  21. (24,0,1);
  22.  
  23. --intento 1
  24. UPDATE A,B,C SET A.APROBADO = A.REVISADO, B.APROBADO = B.REVISADO, C.APROBADO = C.REVISADO;
  25. --intento 2
  26. UPDATE A JOIN B JOIN C SET A.APROBADO = A.REVISADO, B.APROBADO = B.REVISADO, C.APROBADO = C.REVISADO;
  27. --intento 3
  28. UPDATE A                            INNER JOIN
  29.        B ON B.REVISADO = A.REVISADO INNER JOIN
  30.        C ON C.REVISADO = A.REVISADO
  31. SET A.APROBADO = A.REVISADO,
  32.     B.APROBADO = B.REVISADO,
  33.     C.APROBADO = C.REVISADO;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top