Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try for the Select Distinct. #902

Closed
wants to merge 6 commits into from

Conversation

imcharsi
Copy link
Contributor

@imcharsi imcharsi commented Jul 9, 2014

Hi.
At first, I did read #96
This work is for the Select Distinct.
In the Slick, in order to use the select distinct, below syntax is used.

qA.groupBy(t=>t).map(_._1)

And, result sql is like below.

select x1.colA, x1.colB from (...) x1 group by x1.colA, x1.colB

In this work, below syntax is possible, also.

qA.distinct

And, result sql is like below.

select distinct x1.colA, x1.colB from (...) x1

This doesn't introduce any Node classes. Instead, add a one flag into Comprehension.
And, the .distinct method is just a macro for groupBy(t=>t).map(_._1).
Thanks.

Hi.

This work is for the Select Distinct.
In the Slick, in order to use the select distinct, below syntax is used.
  qA.groupBy(t=>t).map(_._1)
And, result sql is like below.
  select x1.colA, x1.colB from (...) x1 group by x1.colA, x1.colB

In this work, below syntax is possible, also.
  qA.distinct
And, result sql is like below.
  select distinct x1.colA, x1.colB from (...) x1

This doesn't introduce any Node classes. Instead, add a one flag into Comprehension.
And, the .distinct method is just a macro for groupBy(t=>t).map(_._1).

Thanks.
Conflicts:
	src/main/scala/scala/slick/compiler/Relational.scala
@kareblak
Copy link

Anything happening on this one?

@deanchen
Copy link

+1 would love to see distinct support in slick

@teldosas
Copy link

teldosas commented May 10, 2017

Is there maybe an overlap with this #1271 ?

@hvesalai hvesalai added this to the Next feature release milestone Feb 28, 2018
@SethTisue
Copy link
Member

closing for inactivity

@SethTisue SethTisue closed this Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants