| Report - SQL Query Help! -
28-09-2006, 03:24 PM
Hi Friends,
I have written a SQL query which lists Ticket ID, Date, Issue raised by, Subject, Ticket Owner, Category, Replies, Status and SLA
SELECT FROM_UNIXTIME(a.dateline,'%d-%b-%y') 'Date', a.ticketid, a.fullname, a.subject,
d.fullname, b.title, a.totalreplies, c.title 'Status', f.title
from swticketpriorities b, swtickets a, swticketstatus c, swstaff d, swslaplanprioritylink e,swslaplans f
WHERE
d.staffid = a.ownerstaffid and
c.ticketstatusid = a.ticketstatusid and
b.priorityid = a.priorityid and
e.slaplanid = f.slaplanid and
e.priorityid=b.priorityid and
a.departmentid = 2 and
MONTH(FROM_UNIXTIME(a.dateline)) = 9
ORDER BY a.dateline DESC
I need to include Avg Response time, Resolution time and a custom field from custom table. I don't know how to use left join and right join in MySQL.
Any help will be appreciated.
Last edited by sureshkumar.mr; 03-10-2006 at 02:56 PM.
|