Using Joins in sql

At work I always get confused on good practice of using joins… here is an example of a practical join.

<cfquery name=“getConcernDetails” datasource=“#someDSN#”>

SELECT

C.concernID, C.ClientID, C.DateCreated,

C.Status, C.ClientEmail, C.isConcern,

C.ownerID, C.ownerGroupID,

a.userID, a.username, s.label

FROM

unmc_Concerns C JOIN WLTAdminusers a ON c.ownerID = a.userid

JOIN WLTsecurity s ON C.ownerGroupID = s.secid

WHERE

C.ConcernID = <cfqueryparam cfsqltype=“cf_sql_integer” value=“#url.var_details#” />

ORDER BY

C.ConcernID

</cfquery>

Leave a comment