1 Reply Latest reply: Jun 27, 2012 8:51 AM by JamesSutherland RSS

    Order BY clause in JPQL

    944992
      Hi all,

      I have a SQL query that works fine in MySQL.

      SELECT e.email FROM Educator e ORDER BY (e.spocInvig + e.educInvig);

      its fetching rows based on the spocinvig and educinvig sum in ascending order.

      but in JPQL i'm getting exception like this.
      Exception Description: Syntax error parsing the query [SELECT e.email FROM Educator e ORDER BY (e.spocInvig + e.educInvig)], line 1, column 41: syntax error at [(].
      Internal Exception: line 1:41: expecting IDENT, found '('

      Can anyone suggest me proper JPQL for the given SQL ?