Best bet is to build a SQL template (select field from table group by field)
in the modeler to do what you want. You can model a view (no different from
a table as far as Cayenne is concerned), but its not necessary.
Do recommend group by over distinct. In my experience, when trying to
extract a unique list of fields like this, distinct has been.......
flaky..... from time to time.
Cris
> -----Original Message-----
> From: tnaki..ofthome.net [mailto:tnakic@softhome.net]
> Sent: Monday, March 21, 2005 9:45 AM
> To: cayenne-use..bjectstyle.org
> Subject: select distinct
>
> Hi everyone,
>
> how would you go about extracting a list of distinct values
> of a single attribute from one table? This is not a
> normalized table and I'm not in a position to normalize it so
> bare with me, please.
> Obviously, a trivial view in the database solves the problem,
> but I'd like to keep code in the application when I can.
> Do I run a raw query from the application? Can I model a view
> containing the distinct values in the modeler?
>
> Tomislav
>
This archive was generated by hypermail 2.0.0 : Mon Mar 21 2005 - 12:39:05 EST