title: JPA: select random row
body: <p>This is my JPA ENTITY</p>
  
  <pre><code>@Entity
  @NamedQueries({  
          @NamedQuery(name = "Question.randQuestion", query = "SELECT q FROM Question AS q ORDER BY     RANDOM")
  })
  @Table(name = "questions")
  public class Question implements Serializable {
  .....
  }
  </code></pre>
  
  <p>The problem is:<bR><br>
  eclipse gives me an error for this namedQuery. It says:
  "The identification variable 'RANDOM' is not defined in the FROM clause"</p>
  
  <p>I've tried also with RAND() instead of RANDOM and also NEWID().</p>
  
  <p>Thanks.</p>