Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
SELECT
contact.id,contact.main_contact_id,contacttitle.`name` as title,contact.company,contact.firstname,contact.lastname,contact.street,contact.zipcode,contact.city,contactstate.`name` as state,contactcountry.`name` as country,contact.phone,contact.phone2,contact.fax,contact.email,contact.mobile,contact.homepage,contact.`comment`,contact.street_private,contact.zipcode_private,contact.city_private,privatestate.`name` as state_private,privatecountry.`name` as country_private,contact.phone_private,contact.phone2_private,contact.fax_private,contact.department,contact.birthday
FROM
contact
LEFT JOIN type_state as contactstate ON contactstate.id = contact.state
LEFT JOIN type_state as privatestate ON privatestate.id = contact.state_private
LEFT JOIN type_title as contacttitle ON contacttitle.id = contact.title_id
LEFT JOIN type_country as contactcountry ON contactcountry.id = contact.country_id
LEFT JOIN type_country as privatecountry ON privatecountry.id = contact.country_id_private
WHERE
contact.deleted = 0
ORDER by main_contact_id ASC

Kontakte aus antony exportieren (über Navicat) mit Mapping der Kontaktdaten auf Ansprechpartner

(Firma, Vorname, Name, Straße, PLZ, Ort)

Code Block
languagesql
SELECT
contact.id,contact.main_contact_id,contacttitle.`name` as title,if(contact.company <> '', contact.company, main_contact.company) as company,if(contact.firstname <> '', contact.firstname, main_contact.firstname) as firstname,if(contact.lastname <> '', contact.lastname, main_contact.lastname) as lastname,if(contact.street <> '', contact.street, main_contact.street) as street,if(contact.zipcode <> '', contact.zipcode, main_contact.zipcode) as zipcode,if(contact.city <> '', contact.city, main_contact.city) as city,contactstate.`name` as state,contactcountry.`name` as country,contact.phone,contact.phone2,contact.fax,contact.email,contact.mobile,contact.homepage,contact.`comment`,contact.street_private,contact.zipcode_private,contact.city_private,privatestate.`name` as state_private,privatecountry.`name` as country_private,contact.phone_private,contact.phone2_private,contact.fax_private,contact.department,contact.birthday
FROM
contact
LEFT JOIN type_state as contactstate ON contactstate.id = contact.state
LEFT JOIN type_state as privatestate ON privatestate.id = contact.state_private
LEFT JOIN type_title as contacttitle ON contacttitle.id = contact.title_id
LEFT JOIN type_country as contactcountry ON contactcountry.id = contact.country_id
LEFT JOIN type_country as privatecountry ON privatecountry.id = contact.country_id_private
LEFT join contact as main_contact ON contact.main_contact_id = main_contact.id
WHERE
contact.deleted = 0
ORDER by main_contact_id ASC

Kontakte aus antony exportieren. Nur eine Kontaktgruppe, inkl. Stichworten

...