I am stuck on this query.
My problem is in the syntax. I can't seem to find the correct way to match records in the "LIKE" clause and to exclude the records that do not match the "LIKE" clause.
I am using a CASE statement because I need to format the output according to the LIKE conditions.
Sample of MYSQL code I am using is posted below.
I have also included an image showing how I desire the output to be formatted.
The image of the desired output is found below.
SELECT DISTINCT S.SalesID, SS.Contact
WHEN Contact IS LIKE '%Manuel%'
WHEN Contact IS NOT LIKE '%Manue%'
END AS Manuel?
FROM Salespeople S
LEFT JOIN Studios SS
ON (S.SalesID = SS.SalesID)
WHERE SS.Contact = 'Manuel Austin' Or
SS.Contact IS NOT NULL;