我正在使用循环查询并在存在要连接的记录时连接表。
当没有记录要加入该行时,有没有办法阻止该行完全返回?
编辑:我错过了其中的 if 语句。我正在循环记录并检查设置选项,如果该设置选项存在于记录中并且查询“someRecord”中没有相应的记录,那么这些是我不想返回的记录。
<cfloop query="myquery">
<cfif listfindnocase(myquery.setup_option,"required_information")>
<cfquery name="someRecord" dbtype="query">
select * from second_table
where key_id = '#myquery.key_id#'
</cfquery>
<cfif someRecord.recordcount eq 0>
<!--- Need something here to remove this row from returning in the query --->
</cfif>
</cfif>
</cfloop>
Run Code Online (Sandbox Code Playgroud)