I have this query
<cfquery datasource="Intranet" name="getMaxstars">
SELECT TOP (1) WITH TIES emp_id, SUM(execoffice_status) AS total_max
FROM CSEReduxResponses
GROUP BY emp_id
ORDER BY total_max DESC
</cfquery >
<cfquery datasource="phonelist" name="getEmployees">
SELECT first_name, last_name, emp_id
FROM employee
</cfquery>
<!--- Query of a query join --->
<cfquery name="getEmployeeStars" dbtype="query">
SELECT getEmployees.first_name + ' ' + getEmployees.last_name AS full_name, getMaxstars.total_max AS stars
FROM getMaxstars, getEmployees
WHERE getMaxstars.emp_id = getEmployees.emp_id
</cfquery>
IN this query I want to get the Max of emp_id in CSEReduxResonses table, what i want to get is to ouput the full name of the employee which only employee table has and also how much stars(execoffice_status) that employee has. so the ouput would look something like this:
John doe 4
i keep getting this error:
Query Of Queries syntax error. Encountered ". Incorrect Select List, Incorrect select column, getEmployees.emp_namefirst cannot be followed by '+'
The error occurred in C:\inetpub\wwwroot\WebServer\win\test\cse_execoffice_newsletter.cfm: line 60
58 :
59 :
60 :
61 : SELECT getEmployees.emp_namefirst + ' ' + getEmployees.emp_namelast AS full_name, getMaxstars.total_max AS [stars]
62 : FROM getMaxstars, getEmployees