[thelist] Coldfusion/SQL:queries:maxrows

Bimal Shah bimal.shah at venus.co.uk
Mon Sep 17 06:41:34 CDT 2001


Hi,

Is there any advantage to using SQL to return
a set number of results compared to using the
maxrows parameter of a cf query?

I am trying to query a table, only wishing to
return the first match e.g

<cfquery name="getLastDate" maxrows="1"...
SELECT
	thedate
FROM
	testTable
WHERE
	thedate<#today#
ORDER BY
	thedate DESC

How would one do the above in pure SQL (without
using maxrows?

Bimal




More information about the thelist mailing list