Skip to content

Instantly share code, notes, and snippets.

Created October 19, 2017 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4fb8ce152e74e978e2f788b375d8f34c to your computer and use it in GitHub Desktop.
Save anonymous/4fb8ce152e74e978e2f788b375d8f34c to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
query function combineQueries(required query q1, required query q2) {
return queryExecute(
"SELECT * FROM q1 UNION SELECT * FROM q2",
[],
{dbtype = "query", q1 = q1, q2 = q2}
);
}
q1 = queryNew("id,mi,en", "integer,varchar,varchar", [
[1, "tahi", "one"],
[2, "rua", "two"]
]);
q2 = queryNew("id,mi,en", "integer,varchar,varchar", [
[3, "toru", "three"],
[4, "wha", "four"]
]);
q3 = combineQueries(q1,q2);
writeDump([q1,q2,q3]);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment