title: Incorrect syntax near the keyword 'ORDER'
body: <p>My application is generating this query.Can someone please tell what is wrong with the query</p>
  
  <pre><code>     SELECT task_id, 
       Count(*) Unread 
       FROM   discussion 
       WHERE  NOT EXISTS (SELECT * 
                          FROM   discussion_read 
                          WHERE  discussion.discussion_id = 
                          discussion_read.discussion_id 
                          AND discussion_read.user_id = ? 
                          AND discussion.task_id IN 
                            ((SELECT TOP 1025 task.task_id 
                              FROM   task 
                              WHERE 
                            ( ( task.task_code = 'A3090' ) 
                              AND ( task.proj_id = 6511 ) )) 
                                                   ORDER  BY task.task_id ASC) 
                ) 
      GROUP  BY task_id 
  </code></pre>