 
 				<!--- add order clause --->
 				<cfset local.sql.order = "">
+				<cfset local.sql.pagination.qualified_select = "">
+				<cfset local.sql.pagination.simple_select = "">
+				<cfset local.sql.pagination.qualified_order = "">
+				<cfset local.sql.pagination.simple_order = "">
+				<cfset local.sql.pagination.qualified_order_reversed = "">
+				<cfset local.sql.pagination.simple_order_reversed = "">
 				<cfif len(arguments.order) IS NOT 0>
 					<cfif arguments.order IS "random">
 						<cfif application.wheels.database.type IS "sqlserver">

								<cfset local.i = FL_extractFromAssociations(include=arguments.include, type="first_column_match_for_select", match=local.i)>
							</cfif>
						</cfif>
						<cfset local.sql.select = listAppend(local.sql.select, local.i)>
					</cfloop>
				<cfelse>
					<cfset local.sql.select = "#variables.class.table_name#.#replace(variables.class.field_list, ',', ',#variables.class.table_name#.', 'all')#">
					<cfif len(variables.class.virtual_field_list) IS NOT 0>
						<cfloop collection="#variables.class.virtual_fields#" item="local.i">
							<cfset local.sql.select = listAppend(local.sql.select, "#variables.class.virtual_fields[local.i].sql# AS #local.i#")>
						</cfloop>
					</cfif>
					<cfif len(arguments.include) IS NOT 0>


		<!--- Get the requested data --->
		<cfif arguments.type IS "full_select_clause">
			<cfset local.return_data = "#local.return_data##chr(7)##local.associated_table_name#.#replace(local.associated_model.getFieldList(), ',', '#chr(7)##local.associated_table_name#.', 'all')#">
			<cfif len(local.virtual_field_list) IS NOT 0>
				<cfloop collection="#local.virtual_fields#" item="local.i">
					<cfset local.return_data = listAppend(local.return_data, "#local.virtual_fields[local.i].sql# AS #local.i#", chr(7))>
				</cfloop>
			</cfif>

