由於我是根據我的同事使用coldfusion的新手,因此我們無法左鍵加入查詢的coldfusion查詢。所以這就是我們會做一個「竅門」來做一個左連接。 例如:在查詢的coldfusion查詢中是否存在左連接?
<cfquery datasource="Intranet" name="GroupStarsGiven">
SELECT execoffice_status, submitterdept, COUNT(*) as 'totalstarsgiven'
FROM CSEReduxResponses
WHERE execoffice_status = 1
GROUP BY execoffice_status, submitterdept
</cfquery>
<cfquery dbtype="query" name="GetTotalStarsGiven">
SELECT *
FROM GroupStarsGiven, GetDepartments
WHERE GroupStarsGiven.submitterdept = GetDepartments.csedept_id
</cfquery>
<cfquery name="joinQuery2" dbtype="query" >
SELECT *
FROM GetTotalStarsGiven
WHERE GetTotalStarsGiven.csedept_id = -1
</cfquery>
<cfset QueryAddRow(joinQuery2)>
<cfquery name="GetUnion2" dbtype="query" >
SELECT *
FROM GetUnion, GetTotalStarsGiven
WHERE GetUnion.csedept_id = GetTotalStarsGiven.csedept_id
UNION
SELECT GetUnion.*, joinQuery2.*
FROM GetUnion, joinQuery2
WHERE GetUnion.csedept_id NOT IN (#ValueList(GetTotalStarsGiven.csedept_id)#)
ORDER BY csedept_name ASC
</cfquery
這是做左連接ColdFusion的方式?只是想確定一下,因爲我無法在此找到一篇好文章。 謝謝
您可能想要爲https://bugbase.adobe.com/index.cfm?event=bug&id=3687749投票。這一不足之處在2007年首次報道(https://bugbase.adobe.com/index.cfm?event=bug&id=3031961),Adobe尚未爲此做任何事情:-( –
「GetUnion」com在哪裏從? –
這是我離開Q. Q. –