Created
July 9, 2025 05:26
-
-
Save trycf/cde74ebad21d7da070fdc10b18451c4a to your computer and use it in GitHub Desktop.
TryCF Gist
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
<cfscript> | |
// Original in-memory query | |
employees = queryNew( | |
"id,name,dept,salary", | |
"CF_SQL_INTEGER,CF_SQL_VARCHAR,CF_SQL_VARCHAR,CF_SQL_INTEGER", | |
[ | |
{ id: 1, name: "Alice", dept: "IT", salary: 50000 }, | |
{ id: 2, name: "Bob", dept: "HR", salary: 45000 }, | |
{ id: 3, name: "Carol", dept: "IT", salary: 52000 }, | |
{ id: 4, name: "Dan", dept: "Finance", salary: 47000 } | |
] | |
); | |
// Query of Query: Filter only IT department | |
itEmployees = queryExecute( | |
"SELECT * FROM employees WHERE dept = 'IT'", | |
[], | |
{ dbtype = "query"} | |
); | |
// Output the filtered result | |
writeDump(itEmployees); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment