New to mysql need help to understand this
SELECT * FROM roles1 r1 ;
result
id role
1 ROLE_SELLER1
1 ROLE_SELLER2
1 ROLE_SELLER3
2 ROLE_SELLER4
2 ROLE_SELLER5
SELECT * FROM roles r1 ;
result
id role
1 ROLE_SELLER1
2 ROLE_SELLER4
UPDATE roles1 r1 ,roles r SET r.role=r1.role WHERE r.id=r1.id ;
after the above update query roles table does not change at all.i thought it should be like
SELECT * FROM roles r1 ;
result
id role
1 ROLE_SELLER3
2 ROLE_SELLER5
SELECT r.,r1. FROM roles r RIGHT JOIN roles1 r1 ON r.id = r1.id;
result
id role id role
1 ROLE_SELLER1 1 ROLE_SELLER1
1 ROLE_SELLER1 1 ROLE_SELLER2
1 ROLE_SELLER1 1 ROLE_SELLER3
2 ROLE_SELLER4 2 ROLE_SELLER4
2 ROLE_SELLER4 2 ROLE_SELLER5
update roles r join roles r1 on r.id = r1.id set r.role = r1.role; i thought when i use this it should update roles table like
result
id role
1 ROLE_SELLER3 (last matched value from roles1 table id 1)
2 ROLE_SELLER5(last matched value from roles1 table id 1)
Thanks in adv...