At 17:18 25.07.2003 +0200, Rafal Kedziorski wrote:
hi,

we have following table:

CREATE TABLE `media_2_project` (
  `media_2_project_id` BIGINT NOT NULL AUTO_INCREMENT,
  `project_id`         BIGINT NOT NULL,
  `media_id`           BIGINT NOT NULL,
  `media_file_id`      BIGINT NOT NULL,
  #
  PRIMARY KEY (`media_2_project_id`),
  ...
);

possible entries could be:

m2p_id | p_id | m_id | mf_id
-----------------------------
   1      1      1       1
   2      1      1       2
   3      1      2       3
   4      1      2       4
   5      2      1       5
   6      2      1       6
   7      2      3       7


now we have a finder findAllByProjectId() and we want DISTINC data by media_id. so for project_id =

I forgot to write that our ejb-ql looks so:


<ejb-ql><![CDATA[SELECT OBJECT(o) FROM media_2_project o WHERE o.project_id = ?1]]></ejb-ql>

and we get 1, 1, 2 and 2 and have make DESTINCT in our business logic.

1 we should get 1 and 2.

normaly you could do this with this query:
SELECT DISTINCT o.media_id o.media_2_project_id FROM media_2_project o WHERE o.project_id = 13


but how can we do this with JBoss-QL?


Regards, Rafal



------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to