When running this query:SELECT DISTINCT (CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END) , * FROMmessage WHERE (senderId= 3851 ORrecipientId= 3851 ) GROUP BY CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END ORDER BY CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END, datetime(dateTime) DESC
Error occurs:
java.lang.IllegalArgumentException: Unknown column name '(CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END)' in table message
As far as I am aware query is fine and sqlite can manage distinction and cases.
_The code i am running: _
When running this query:
SELECT DISTINCT (CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END) , * FROM
messageWHERE (
senderId= 3851 OR
recipientId= 3851 ) GROUP BY CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END ORDER BY CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END, datetime(dateTime) DESC
Error occurs: java.lang.IllegalArgumentException: Unknown column name '(CASE WHEN senderId = 3851 THEN recipientId ELSE senderId END)' in table message
As far as I am aware query is fine and sqlite can manage distinction and cases. _The code i am running: _
Is this a bug?