Compare two columns for difference mark the difference in mysql
I need to compare two fields and mark the similar fields in third table.
For Example:
Tables
customer:
phone id,
phonenumber
followstatus
received_Customer:
rc_id,
rc_phonenumber.
I need to mark the fdnumber
with f
or n/a
in follow up which is in received and customer table.
update customer
select b.phonenumber
from received_customer n
join customer b
on b.phonenumber = n.phonenumber
SET followUpStatus= 'y' ;
I run query in php.
mysql update join
add a comment |
I need to compare two fields and mark the similar fields in third table.
For Example:
Tables
customer:
phone id,
phonenumber
followstatus
received_Customer:
rc_id,
rc_phonenumber.
I need to mark the fdnumber
with f
or n/a
in follow up which is in received and customer table.
update customer
select b.phonenumber
from received_customer n
join customer b
on b.phonenumber = n.phonenumber
SET followUpStatus= 'y' ;
I run query in php.
mysql update join
add a comment |
I need to compare two fields and mark the similar fields in third table.
For Example:
Tables
customer:
phone id,
phonenumber
followstatus
received_Customer:
rc_id,
rc_phonenumber.
I need to mark the fdnumber
with f
or n/a
in follow up which is in received and customer table.
update customer
select b.phonenumber
from received_customer n
join customer b
on b.phonenumber = n.phonenumber
SET followUpStatus= 'y' ;
I run query in php.
mysql update join
I need to compare two fields and mark the similar fields in third table.
For Example:
Tables
customer:
phone id,
phonenumber
followstatus
received_Customer:
rc_id,
rc_phonenumber.
I need to mark the fdnumber
with f
or n/a
in follow up which is in received and customer table.
update customer
select b.phonenumber
from received_customer n
join customer b
on b.phonenumber = n.phonenumber
SET followUpStatus= 'y' ;
I run query in php.
mysql update join
mysql update join
edited Dec 30 '14 at 11:51
jynus
11k11832
11k11832
asked Dec 30 '14 at 11:46
Benson K BBenson K B
83
83
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Try the following:
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
New contributor
add a comment |
That is not the correct syntax for an UPDATE+JOIN. Try the following (assuming it is what you want, updating the table customer):
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
Not Working .. ITs running on and on..
– Benson K B
Dec 31 '14 at 6:07
If you give us the structure of both tables I can help you with potential indexes to speed up the process like 1000x.
– jynus
Dec 31 '14 at 10:18
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f87237%2fcompare-two-columns-for-difference-mark-the-difference-in-mysql%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try the following:
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
New contributor
add a comment |
Try the following:
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
New contributor
add a comment |
Try the following:
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
New contributor
Try the following:
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
New contributor
New contributor
answered 2 mins ago
Ajeet KumarAjeet Kumar
16
16
New contributor
New contributor
add a comment |
add a comment |
That is not the correct syntax for an UPDATE+JOIN. Try the following (assuming it is what you want, updating the table customer):
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
Not Working .. ITs running on and on..
– Benson K B
Dec 31 '14 at 6:07
If you give us the structure of both tables I can help you with potential indexes to speed up the process like 1000x.
– jynus
Dec 31 '14 at 10:18
add a comment |
That is not the correct syntax for an UPDATE+JOIN. Try the following (assuming it is what you want, updating the table customer):
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
Not Working .. ITs running on and on..
– Benson K B
Dec 31 '14 at 6:07
If you give us the structure of both tables I can help you with potential indexes to speed up the process like 1000x.
– jynus
Dec 31 '14 at 10:18
add a comment |
That is not the correct syntax for an UPDATE+JOIN. Try the following (assuming it is what you want, updating the table customer):
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
That is not the correct syntax for an UPDATE+JOIN. Try the following (assuming it is what you want, updating the table customer):
UPDATE customer b
JOIN received_customer n
ON b.phonenumber = n.phonenumber
SET b.followUpStatus= 'y' ;
answered Dec 30 '14 at 11:53
jynusjynus
11k11832
11k11832
Not Working .. ITs running on and on..
– Benson K B
Dec 31 '14 at 6:07
If you give us the structure of both tables I can help you with potential indexes to speed up the process like 1000x.
– jynus
Dec 31 '14 at 10:18
add a comment |
Not Working .. ITs running on and on..
– Benson K B
Dec 31 '14 at 6:07
If you give us the structure of both tables I can help you with potential indexes to speed up the process like 1000x.
– jynus
Dec 31 '14 at 10:18
Not Working .. ITs running on and on..
– Benson K B
Dec 31 '14 at 6:07
Not Working .. ITs running on and on..
– Benson K B
Dec 31 '14 at 6:07
If you give us the structure of both tables I can help you with potential indexes to speed up the process like 1000x.
– jynus
Dec 31 '14 at 10:18
If you give us the structure of both tables I can help you with potential indexes to speed up the process like 1000x.
– jynus
Dec 31 '14 at 10:18
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f87237%2fcompare-two-columns-for-difference-mark-the-difference-in-mysql%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown