Skip to content

Instantly share code, notes, and snippets.

@oak-tree
Created September 1, 2014 09:51
Show Gist options
  • Select an option

  • Save oak-tree/27023b24f796341f43cd to your computer and use it in GitHub Desktop.

Select an option

Save oak-tree/27023b24f796341f43cd to your computer and use it in GitHub Desktop.
Hibernate:
select
count(reportqs0_.REPORT_ID) as col_0_0_
from
reports reportqs0_
inner join
reports_projects projects1_
on reportqs0_.REPORT_ID=projects1_.report_id
inner join
projects project2_
on projects1_.project_id=project2_.PROJECT_ID
inner join
tblProject_permission permission3_
on project2_.CODE=permission3_.project
where
permission3_.user_id=?
and (
reportqs0_.cleanTxt like ?
or reportqs0_.REPORT_ID=-1
)
and permission3_.user_id=?
and (
reportqs0_.TXT like ?
or reportqs0_.REPORT_ID=-1
)
group by
reportqs0_.REPORT_ID
@oak-tree

oak-tree commented Sep 1, 2014

Copy link
Copy Markdown
Author

actually removing groupby gives the expected result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment