I am using a query to search a ticket no with eigther tickettype is like "EMER" or "Short Notice", but iam getting multiple values. Its not searching with the ticket no. Please let me know what the issue is in my query. Below is the query
I am getting the below result with different ticketnos, ia m expecting only the ticketno in the where condition.
Code:
SELECT T.Ticketsid, T.TicketType, T.TicketNo FROM Tickets T INNER JOIN TicketCustomers TC ON TC.TicketsId= T.TicketsId LEFT JOIN correspondence C ON C.Ticketsid = T.Ticketsid WHERE T.TicketNo='102081837' AND T.TicketType LIKE '%EMER%' OR T.TicketType = 'SHORT NOTICE' GROUP BY TC.TicketCustomersId ORDER BY T.Ticket_Rec_Date DESC
Code:
Ticketsid TicketType TicketNo 4661 SHORT NOTICE 102180761 4659 SHORT NOTICE 102180758 4657 SHORT NOTICE 102180751 3998 SHORT NOTICE 102161521 2944 SHORT NOTICE 102141331 1292 SHORT NOTICE 102081837
Comment