0

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.

1

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' ;
| improve this answer | |
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.