Results 1 to 15 of 15
Thread: Problem with Alias and WHERE
Jan 24, 2014, 11:11 #1
- Join Date
- Aug 2010
- 2 Post(s)
- 0 Thread(s)
Problem with Alias and WHERE
I have a query which returns all PM's in the Trash Folder.
It is a UNION of Query #1 which returns "Deleted Incoming" messages, and Query #2 which returns "Deleted Sent" messages.
In Query #1, I have a column/alias called..
r.recipient_read_on AS read_on
-1 AS read_on
Now I want to filter the record-set on whether there is a "-1" for "read_on" - which would tell me if it is a "Sent Message", but apparently I cannot use an Alias in the WHERE statement.
WHERE pm.id = 90 AND pm.sender_id = 11 AND pm.sender_deleted_on IS NOT NULL AND pm.sender_purged_on IS NULL AND read_on = -1