0 Replies Latest reply on Oct 24, 2002 1:24 AM by Maggie Alterego

    DISTINCT keyword interferes with ORDER BY

    Maggie Alterego Newbie

      Configuration: jboss3.2beta, win2k, jdk 1.4.0_01.

      Am experiencing a strang problem with a dynamic-ql query. The query being built looks like:

      Select Object(con)
      FROM Contact AS con
      WHERE ?1 MEMBER OF con.categories
      ORDER BY con.searchableName ASC

      If I omit the keyword DISTINCT from the query, the expected results are returned properly ordered, but with duplicate results. If I put in the DISTINCT keyword, duplicate results are filtered, but the result comes back ordered by pk.

      Any suggestions would be appreciated.