title: ERROR: org.hibernate.hql.internal.ast.ErrorCounter - line 1:45: unexpected token : DESC on fetching the last record from the table
body: <p>I am trying to fetch the last record from the database using the below hibernate query</p>
  
  <pre><code>//fetch the last data from a field in a table
  Session session = _sessionFactory.getCurrentSession();
  Query query = session.createQuery("select t.currentfile from file t DESC");
  query.setMaxResults(1);
  List&lt;Object[]&gt; rows = query.list();
  
  for (Object[] row: rows) {
      System.out.println(" ------------------- ");
      System.out.println("current file: " + row[0]);
  }
  </code></pre>
  
  <p>with the above hql I am getting this error:</p>
  
  <pre><code>ERROR: org.hibernate.hql.internal.ast.ErrorCounter - line 1:45: unexpected token
  : DESC
  </code></pre>
  
  <p>what could be wrong?</p>