HQL (Hazırda Bekletme Dili) kullanarak iki tablo arasında bir Birleşim oluşturmaya çalışıyorum.HQL'de bir Union SQL deyimi nasıl yapılır?
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: (near line 1, column 83 [select count(distinct linkedinId) as countOfEdu, schoolName as SchoolName from (SELECT * FROM alumEducation UNION SELECT * FROM alumConnectionEducations) AS UNIONS where schoolName='Duquesne University']
:
def countOfEdu = AlumEducation.executeQuery("select count (distinct linkedinId) as countOfEdu, schoolName as SchoolName from (SELECT * FROM alumEducation UNION SELECT * FROM alumConnectionEducations) AS UNIONS where schoolName='some string'")
ben bu hatayı alıyorum: ben böyle grails onu çalıştırmayı denediğinizde
SELECT COUNT(DISTINCT linkedin_id) as test, school_name
FROM
(SELECT * FROM alum_education
UNION
SELECT * FROM alum_connection_educations) AS UNIONS where school_name='some string'
sorun şudur: Bu SQL komut benim SQL sunucusu üzerinde çalışıyor
Yukarıdaki SQL deyimini grails'te nasıl çalıştırabilirim?
sayesinde jason
Olası yinelenen: http://stackoverflow.com/questions/201023/hibernate-union-alternatives –
yorumunu – jellobird