Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- No Changed Rows Produced by this mySQL update query. Why?
- +--------+-----------------------+
- | id | email |
- +--------+-----------------------+
- | 142755 | xxxxxxx@xxxxxxxxx.com |
- +--------+-----------------------+
- +--------+------------------------+
- | person | email |
- +--------+------------------------+
- | 0 | xxxxxxx@xxxxxxxxx.com |
- +--------+------------------------+
- UPDATE
- person, no_dma
- SET no_dma.person = person.id
- WHERE person.email = no_dma.email;
- Query OK, 0 rows affected (9.31 sec)
- Rows matched: 0 Changed: 0 Warnings: 0
- mysql> select person, email from no_dma limit 0,1;
- +--------+------------------------+
- | person | email |
- +--------+------------------------+
- | 0 | tom_r1989@xxxxxxx.com
- +--------+------------------------+
- 1 row in set (0.00 sec)
- mysql> select email from no_dma where email = 'tom_r1989@xxxxxxx.com';
- Empty set (0.00 sec)
- mysql> select email from no_dma where TRIM(email) = 'tom_r1989@xxxxxxx.com';
- Empty set (0.46 sec)
- mysql> SELECT CONCAT('"',email,'"') from no_dma limit 0,3;
- +-----------------------+
- | CONCAT('"',email,'"') |
- +-----------------------+
- " |amjor308@xxx.com
- " |utt@xxx.com
- " |00000000@xxx.com
- +-----------------------+
- mysql> SELECT email from no_dma limit 0,3;
- +--------------------+
- | email |
- +--------------------+
- |+amjor308@xxx.com
- |mutt@xxx.com
- |000000000@xxx.com
- +--------------------+
- mysql> SELECT TRIM(email) from no_dma limit 0,3;
- +--------------------+
- | TRIM(email) |
- +--------------------+
- |+amjor308@aol.com
- |mutt@excite.com
- |000000000@aol.com
- +--------------------+
- 3 rows in set (0.00 sec)
Add Comment
Please, Sign In to add comment