mysql - How to update a field in table withrepect to the data in another table Coloumn using Trigger -


i have 2 tables namely enquiry_details , customer_details, if customer name enquiry_details table in customer_details table need update enquiry_details table status of existing customer field yes otherwise no.

this should done using trigger. kindly trigger code.

thanks, acube.

create trigger track_customer before insert on enquiry_details each row begin if (select count(*) customer_details customer_name = new.customer_name) <= 0 set new.existing_customer = 'no'; else set new.existing_customer = 'yes'; end if; end;//


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -