MySQL Forums
Forum List  »  Newbie

Re: Same Mysql Update query giving different result in linux and windows
Posted by: Peter Brawley
Date: November 28, 2016 04:44PM

The problem is easier to spot (as always) with explicit join syntax ...

update s_Last7days b
join buildmapping c using(build, buildminor, branchname)
set b.ver=c.ver
where b.ver=0 ;

Three buildmapping rows match join criteria in the Update cmd. Which joined value is to be used to update s_Last7days is undefined, ie it's arbitrary.

To remove the ambiguity, specify which joined value is to be used for the update.

BTW, uppercase letters in object names can cause problems when porting between Windows & Linux installations, best keep all names lower case.



Edited 2 time(s). Last edit at 11/28/2016 05:04PM by Peter Brawley.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.