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

3.0 book, union and limit #2538

Closed
ionas opened this issue Mar 25, 2015 · 2 comments
Closed

3.0 book, union and limit #2538

ionas opened this issue Mar 25, 2015 · 2 comments
Assignees
Milestone

Comments

@ionas
Copy link
Contributor

ionas commented Mar 25, 2015

The book should explain briefly how to add a limit() after doing a union (on the union result)
Rel: http://book.cakephp.org/3.0/en/orm/query-builder.html#unions

@antograssiot antograssiot added this to the 3.0 milestone Mar 25, 2015
@markstory markstory self-assigned this Mar 26, 2015
@markstory
Copy link
Member

This might be tricky as applying limits to unions in a cross vendor way is not simple. The most compatible way to do it is with yet another select statement.

@ionas
Copy link
Contributor Author

ionas commented Mar 26, 2015

Yeah... hm. Some user found a way to add epilogue() or so to the query to have the limit run on the union but that might still be mysql only.

While I am not entirely happy as it is a very rare case (unions, I hope) I am going to close this.

Edit: maybe the book should simply state that LIMIT or other statements on SQL-Unions heavily vary depending on the chosen RDMBS and then link to newExpr(), epilogue() or whatever necessary?.

@ionas ionas closed this as completed Mar 26, 2015
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

No branches or pull requests

3 participants