This is from another thread but is more important to this one.
Why is this code producing nothing, when i can see the last row in the database with id 97, has 'customer' in the updated by field.
ticket 16115
95 > dateupdated is not null > datetrashed is null > dateclosed is null > updatedby = 'customer'.
96 > dateupdated is not null > datetrashed is null > dateclosed is null > updatedby = 'admin'.
97 > dateupdated is not null > datetrashed is null > dateclosed is null > updatedby = 'customer'.
Yes it's producing nothing at all. surely it should be producing it, based on row 97?!
Even this produces nothing, and I am giving it the answer of the ticket!!
Code: Select all
SELECT MAX(id) AS id, ticket, subject, dateupdated, updatedby, datetrashed, dateclosed
FROM tickets
WHERE datetrashed IS NULL
AND ticket = '16115'
AND dateclosed IS NULL
AND dateupdated IS NOT NULL
GROUP BY ticket
HAVING updatedby = 'customer'