Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in Constructor Expressions  RSS feed

 
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!