Guest User

Untitled

a guest
Sep 6th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. No Changed Rows Produced by this mySQL update query. Why?
  2. +--------+-----------------------+
  3. | id | email |
  4. +--------+-----------------------+
  5. | 142755 | xxxxxxx@xxxxxxxxx.com |
  6. +--------+-----------------------+
  7.  
  8. +--------+------------------------+
  9. | person | email |
  10. +--------+------------------------+
  11. | 0 | xxxxxxx@xxxxxxxxx.com |
  12. +--------+------------------------+
  13.  
  14. UPDATE
  15. person, no_dma
  16. SET no_dma.person = person.id
  17. WHERE person.email = no_dma.email;
  18.  
  19. Query OK, 0 rows affected (9.31 sec)
  20. Rows matched: 0 Changed: 0 Warnings: 0
  21.  
  22. mysql> select person, email from no_dma limit 0,1;
  23. +--------+------------------------+
  24. | person | email |
  25. +--------+------------------------+
  26. | 0 | tom_r1989@xxxxxxx.com
  27. +--------+------------------------+
  28. 1 row in set (0.00 sec)
  29.  
  30. mysql> select email from no_dma where email = 'tom_r1989@xxxxxxx.com';
  31. Empty set (0.00 sec)
  32.  
  33. mysql> select email from no_dma where TRIM(email) = 'tom_r1989@xxxxxxx.com';
  34. Empty set (0.46 sec)
  35.  
  36. mysql> SELECT CONCAT('"',email,'"') from no_dma limit 0,3;
  37. +-----------------------+
  38. | CONCAT('"',email,'"') |
  39. +-----------------------+
  40. " |amjor308@xxx.com
  41. " |utt@xxx.com
  42. " |00000000@xxx.com
  43. +-----------------------+
  44.  
  45.  
  46. mysql> SELECT email from no_dma limit 0,3;
  47. +--------------------+
  48. | email |
  49. +--------------------+
  50. |+amjor308@xxx.com
  51. |mutt@xxx.com
  52. |000000000@xxx.com
  53. +--------------------+
  54.  
  55. mysql> SELECT TRIM(email) from no_dma limit 0,3;
  56. +--------------------+
  57. | TRIM(email) |
  58. +--------------------+
  59. |+amjor308@aol.com
  60. |mutt@excite.com
  61. |000000000@aol.com
  62. +--------------------+
  63. 3 rows in set (0.00 sec)
Add Comment
Please, Sign In to add comment