Select DISTINCT

3 views
Skip to first unread message

NoS...@rigel222.com

unread,
Feb 10, 2011, 1:36:14 PM2/10/11
to risee...@googlegroups.com
How do I use the list method to incorporate the MySQL DISTINCT functionality?

Name City
==============
Greg New York
Sally Seattle
Dave New York
Sue Phoenix

How Do I Make The List Method Return Only DISTINCT Cities?
(So New York Does Not Appear Twice)


Joar Swenning

unread,
Feb 11, 2011, 5:53:07 AM2/11/11
to RISE, NoS...@rigel222.com
Hi,
When using RISE for information modeling, what you do with a list
method based on an entity is that you retrieve the objects. The
objects will always be distinct so in this context a distinct method
would not be relevant.

You can always use custom and composed methods to create what you need
if you e.g. want to operate on the values in some way. In this
specific case however; I believe that the solution lies in the
modeling.

If the distinct cities are relevant, it seems reasonable that City
should be an entity of its own in your model. Whether it should be
directly related to an attribute of your other entity (Person?) or
values should be copied into it, is a matter of what you are trying to
achieve.

Best regards,
Joar
Reply all
Reply to author
Forward
0 new messages