If you use maxrows then CF returns the WHOLE query record and then
grabs the last 3.. So if you have a million rows.. CF gets the whole
million rows then gabs the last 3.
If you use the DB to get the last three then it'll only send 3 records
to CF. So performance should be better allowing the DB to do the
getting and filtering.
Unless CF is doing something else...


On Mon, Mar 10, 2008 at 12:47 PM, Daniel Kessler <[EMAIL PROTECTED]> wrote:
> here's how I do it on my events calendar, using SQL.  I believe it
>  also can be done in the CFOUTPUT tag.  I prefer to put the onus on
>  the database server (NOT that I'm any expert):
>
>  <CFQUERY NAME="todays_event" DATASOURCE="dch">
>         SELECT id,header,start_date
>         FROM (
>
>         SELECT id,header,start_date
>         FROM hsp_calendar
>         ORDER BY START_DATE ASC
>
>         )
>         WHERE rownum <=5
>  </CFQUERY>
>
>
>
>  On Mar 10, 2008, at 1:42 PM, Frank Velazquez wrote:
>
>  > Hey guys, what's up? I was wondering how could I select the last 3
>  > records (or more) that have been inserted into my Database, should
>  > I use recordcount?
>  >
>  > I need that because on my site, in the home page I want to display
>  > recently added stuff.
>  >
>  > Thank you!
>  >
>  > Frank V.
>  >
>  >
>
>  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3408
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to