मैं एचक्यूएल (हाइबरनेट क्वेरी भाषा) का उपयोग करके दो तालिकाओं के बीच एक संघ बनाने की कोशिश कर रहा हूं।एचक्यूएल में यूनियन एसक्यूएल स्टेटमेंट कैसे करें?
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'
समस्या यह है, जब मैं इस तरह grails में इसे चलाने के लिए प्रयास करें:: यह SQL स्क्रिप्ट मेरे एसक्यूएल सर्वर पर ठीक काम करता है
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'")
मैं इस त्रुटि मिलती है
मैं उपरोक्त SQL कथन को grails में कैसे चला सकता हूं?
धन्यवाद जेसन
संभावित डुप्लिकेट: http://stackoverflow.com/questions/201023/hibernate-union-alternatives –
टिप्पणी – jellobird