Hi i want to write a query using criteria : The following query has to be created using criteria:
"Select Distinct(s2Taxper) from S2 where s2Tc='601' AND s2Txcd!=''"
thanks in advance
Hi i want to write a query using criteria : The following query has to be created using criteria:
"Select Distinct(s2Taxper) from S2 where s2Tc='601' AND s2Txcd!=''"
thanks in advance
Criteria criteria =
session.createCriteria(S2.class)
.add(Restrictions.eq("s2Tc","601"))
.add(Restrictions.ne("s2Txcd",""))
.setProjection(Projections.distinct(Projections.property("s2Taxper")));
ERROR [http-nio-8443-exec-8] SqlExceptionHelper.logExceptions(146) | ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
after using setProjection(). –
Fafnir © 2022 - 2024 — McMap. All rights reserved.