I am inserting data in MySQL into the contacts module/table from another tables, but the âcontactsâ table does not have an email address column. I see that âcontacts_cstmâ and âcontactsâ have a primary key âidâ, but when I look at the email tables, I cannot find the corresponding primary key between contacts and email addresses.
So my question is how do I write the query that adds emails from my table to the contactâs emails table in SuiteCRM?
Below is the query I use to insert most of the fields
INSERT INTO contacts(
id,
first_name,
last_name,
photo,
phone_home,
phone_mobile,
phone_fax,
primary_address_street,
primary_address_city,
primary_address_state,
primary_address_postalcode,
birthdate,
/*email would ideally go here in this query*/
)
SELECT
ClientID,
Firstname,
Lastname,
Photo,
Homephone,
Mobilephone,
Fax,
Address,
City,
`State/Prov`,
Zipcode,
DoB,
Email1 ,
FROM
exampletable;