Created
November 5, 2019 18:16
-
-
Save bardware/268d8dd37dae3c75141c272c9c59e13d to your computer and use it in GitHub Desktop.
JOIN inColdFusion QoQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset q1=QueryNew( | |
"Date,User,Col1,Col2,Col3", | |
"varchar,varchar,integer,integer,integer", | |
[ | |
{ | |
Date = "08/2019", | |
User = "Sam", | |
Col1 = 1, | |
Col2 = 2, | |
Col3 = 3 | |
}, | |
{ | |
Date = "09/2019", | |
User = "Sam", | |
Col1 = 5, | |
Col2 = 7, | |
Col3 = 8 | |
} | |
] | |
)> | |
<cfset q2=QueryNew( | |
"Date,User,Col4,Col5", | |
"varchar,varchar,integer,integer", | |
[ | |
{ | |
Date = "09/2019", | |
User = "Sam", | |
Col4 = 4, | |
Col5 = 5 | |
} | |
] | |
)> | |
<cfdump var="#q1#"> | |
<cfdump var="#q2#"> | |
<cfset qCombined = QueryExecute("SELECT * | |
FROM q1, q2 | |
WHERE q1.User = q2.user", | |
[], | |
{ dbtype = "query"} | |
)> | |
<cfdump var="#qCombined#"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/22979292/is-there-a-left-join-in-coldfusion-query-of-queries
http://instantbadger.blogspot.com/2006/07/faking-left-outer-join-in-query-of.html