Leser: 2
|< 1 2 3 >| | 28 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
SELECT
contacts.id AS 'contacts_id',
contacts.sex AS 'contacts_sex',
contacts.givenname AS 'contacts_givenname',
contacts.surname AS 'contacts_surname',
contacts.company AS 'contacts_company',
contacts.email AS 'contacts_email',
contacts.phone AS 'contacts_phone',
contacts.fax AS 'contacts_fax',
contacts.ticket AS 'contacts_ticket',
contacts.position_id AS 'contacts_position_id',
contacts.numofemployees_id AS 'contacts_numofemployees_id',
contacts.contacttype_id AS 'contacts_contacttype_id',
conversation.id AS 'conversation_id',
conversation.contact_id AS 'conversation_contact_id',
conversation.agent_id AS 'conversation_agent_id',
conversation.inquiry AS 'conversation_inquiry',
conversation.inquiry_time AS 'conversation_inquiry_time',
conversation.inquiry_notification_sent AS 'conversation_inquiry_notification_sent',
conversation.answer AS 'conversation_answer',
conversation.answer_time AS 'conversation_answer_time',
conversation.answer_notification_sent AS 'conversation_answer_notification_sent'
FROM
jm_contact_contacts contacts
LEFT JOIN
jm_contact_conversation conversation
ON
(contacts.id = conversation.contact_id)
ORDER BY
conversation.inquiry_time DESC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SELECT
contacts.id AS 'contacts_id',
contacts.sex AS 'contacts_sex',
contacts.givenname AS 'contacts_givenname',
contacts.surname AS 'contacts_surname',
contacts.company AS 'contacts_company',
contacts.email AS 'contacts_email',
contacts.phone AS 'contacts_phone',
contacts.fax AS 'contacts_fax',
contacts.ticket AS 'contacts_ticket',
contacts.position_id AS 'contacts_position_id',
contacts.numofemployees_id AS 'contacts_numofemployees_id',
contacts.contacttype_id AS 'contacts_contacttype_id',
conversation.id AS 'conversation_id',
conversation.contact_id AS 'conversation_contact_id',
conversation.agent_id AS 'conversation_agent_id',
conversation.inquiry AS 'conversation_inquiry',
conversation.inquiry_time AS 'conversation_inquiry_time',
conversation.inquiry_notification_sent AS 'conversation_inquiry_notification_sent',
conversation.answer AS 'conversation_answer',
conversation.answer_time AS 'conversation_answer_time',
conversation.answer_notification_sent AS 'conversation_answer_notification_sent',
jm_contact_positions.value,
jm_contact_numofemployees.value,
jm_contact_contacttypes.value
FROM
jm_contact_contacts contacts
LEFT JOIN
jm_contact_conversation conversation
ON
(contacts.id = conversation.contact_id)
JOIN jm_contact_positions ON (contacts.position_id = jm_contact_positions.id)
JOIN jm_contact_numofemployees ON (contacts.numofemployees_id = jm_contact_numofemployees.id)
JOIN jm_contact_contacttypes ON (jm_contact_contacttypes.id = contacts.contacttype_id)
ORDER BY
conversation.inquiry_time DESC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SELECT
contacts.id AS 'contacts_id',
contacts.sex AS 'contacts_sex',
contacts.givenname AS 'contacts_givenname',
contacts.surname AS 'contacts_surname',
contacts.company AS 'contacts_company',
contacts.email AS 'contacts_email',
contacts.phone AS 'contacts_phone',
contacts.fax AS 'contacts_fax',
contacts.ticket AS 'contacts_ticket',
contacts.position_id AS 'contacts_position_id',
contacts.numofemployees_id AS 'contacts_numofemployees_id',
contacts.contacttype_id AS 'contacts_contacttype_id',
conversation.id AS 'conversation_id',
conversation.contact_id AS 'conversation_contact_id',
conversation.agent_id AS 'conversation_agent_id',
conversation.inquiry AS 'conversation_inquiry',
conversation.inquiry_time AS 'conversation_inquiry_time',
conversation.inquiry_notification_sent AS 'conversation_inquiry_notification_sent',
conversation.answer AS 'conversation_answer',
conversation.answer_time AS 'conversation_answer_time',
conversation.answer_notification_sent AS 'conversation_answer_notification_sent',
jm_contact_positions.value,
jm_contact_numofemployees.value,
jm_contact_contacttypes.value,
MIN(jm_contact_conversation.inquiry_time),
MAX(jm_contact_conversation.inquiry_time),
FROM
jm_contact_contacts contacts
LEFT JOIN
jm_contact_conversation conversation
ON
(contacts.id = conversation.contact_id)
JOIN jm_contact_positions ON (contacts.position_id = jm_contact_positions.id)
JOIN jm_contact_numofemployees ON (contacts.numofemployees_id = jm_contact_numofemployees.id)
JOIN jm_contact_contacttypes ON (jm_contact_contacttypes.id = contacts.contacttype_id)
GROUP BY
jm_contact_contacts.contact_id
ORDER BY
conversation.inquiry_time DESC
SELECT tb2.count - tb1.count FROM tabelle as tb1, tabelle as tb2 WHERE tb1.end = tb2.start;
|< 1 2 3 >| | 28 Einträge, 3 Seiten |