Versions Compared

Key

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

...

Code Block
languagesql
SELECT
(SELECT GROUP_CONCAT(DISTINCT tags.text SEPARATOR ',') FROM tags WHERE (tags.id = SUBSTRING_INDEX(SUBSTRING_INDEX(ip.tags, '\|', 2), '\|', -1) or tags.id = SUBSTRING_INDEX(SUBSTRING_INDEX(ip.tags, '\|', 3), '\|', -1) or tags.id = SUBSTRING_INDEX(SUBSTRING_INDEX(ip.tags, '\|', 4), '\|', -1) or tags.id = SUBSTRING_INDEX(SUBSTRING_INDEX(ip.tags, '\|', 5), '\|', -1)) AND tags.text <> ''),
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-group`, 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 instance_properties as ip ON ip.object_id = contact.id AND ip.instance_id = 1
WHERE
contact.deleted = 0 AND
`contact-group`.contact_id = contact.id AND `contact-group`.group_id = 3
AND ip.tags <> ''
ORDER by main_contact_id ASC

Termine aus antony als CSV exportieren (über Navicat)

Code Block
languagesql
select 
allday as 'ganztaegiges ereigniss', 
DATE_FORMAT(start, '%Y-%m-%d') as 'beginnt am',
DATE_FORMAT(start, '%T') as 'beginnt um', 
DATE_FORMAT(end, '%Y-%m-%d') as 'endet am',
DATE_FORMAT(end, '%T') as 'endet um', 
subject as 'betreff',
location as 'ort',
description as 'beschreibung',
cr.caption
FROM appointment
LEFT JOIN appointment_resource ar ON ar.appointment_id = appointment.id
LEFT JOIN calendar_resource cr ON cr.id = ar.resource_id
WHERE
private = 0 AND recurrence_type = 0

Alle Kontakte löschen

z.B. nach einem fehlgeschlagenen Kontaktimport

...