Stub suggests
21:22 < stub> SELECT DISTINCT ON (BugTask.id) BugTask.* 21:22 < stub> FROM BugTask, Bug, BugMessage, Message 21:22 < stub> WHERE 21:22 < stub> Bug.id = BugTask.bug 21:22 < stub> AND Bug.id = BugMessage.bug 21:22 < stub> AND BugMessage.message = Message.id 21:22 < stub> AND BugTask.status in (10, 15, 20, 21, 22, 25) 21:22 < stub> AND Bug.duplicateof IS NULL 21:22 < stub> AND Bug.private = FALSE 21:22 < stub> AND BugMessage.index > 0 21:22 < stub> AND Message.owner = 931129 21:22 < stub> ORDER BY BugTask.id;
Stub suggests
21:22 < stub> SELECT DISTINCT ON (BugTask.id) BugTask.*
21:22 < stub> FROM BugTask, Bug, BugMessage, Message
21:22 < stub> WHERE
21:22 < stub> Bug.id = BugTask.bug
21:22 < stub> AND Bug.id = BugMessage.bug
21:22 < stub> AND BugMessage.message = Message.id
21:22 < stub> AND BugTask.status in (10, 15, 20, 21, 22, 25)
21:22 < stub> AND Bug.duplicateof IS NULL
21:22 < stub> AND Bug.private = FALSE
21:22 < stub> AND BugMessage.index > 0
21:22 < stub> AND Message.owner = 931129
21:22 < stub> ORDER BY BugTask.id;