0 Replies Latest reply on Apr 24, 2006 3:54 PM by Ray Slee

    Is the DISTINCT statement redundant?

    Ray Slee Newbie

      Just wondering how developers using DISTINCT within their EJB3 Queries are dealing with this.

      Maybe I missed something, but if I'm required to have a unique @Id for each instance then it appears redundant to try a DISTINCT statement as all results will be distinct as they have a unique key.

      The @Id is at the class level and the DISTINCT is at the sql statement level so they are not interchangable but appear to be mutually exlusive.

      How can I stop the unique key being used when running a distinct query?
      Can I specify the variables of an Object that I want to run distinct against:

      e.g.

      select distinct( Course.number, Course.period etc.) from Course....

      and what would the synax be?

      cheers
      Ray