• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Constructor Expressions

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
select NEW org.UserDto(distinct(orgreg.contactNumber)) from OrganisationRegistration orgreg

Hi
The above query throws runtime exception due to distinct keyword.

Is there any solution available.

Thanks
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DISTINCT only applies to the entire query (the only exception is its usage with an aggregate function).

Select distinct NEW org.UserDto(orgreg.contactNumber) from OrganisationRegistration orgreg
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic