Ask a Question related to Coldfusion Database Access, Design and Development.
-
noodleweb #1
find last two records
Hi guys, problem,
need to display last two records inserted into a database by date.two tables are joined by common columnname
whats the best way to do that?
using cf7 and mysql
:confused;
noodleweb Guest
-
trailing slash issue in Find.find
require "find" Find.find("/usr/bin/") { |file| puts file } /usr/bin//rmdir /usr/bin//rm /usr/bin//mv /usr/bin//mknod /usr/bin//mkfifo... -
Cancel Find shows all records
Due to some bad design decisions and the 50 file limit, we have a few files that contain records representing completely different things, each... -
After Find records then Omit (Active in field)
After Find records (Birthday date in 30 days future) then omit inactive... so, I can see active only in 30 days future. How can I insert omit's... -
Find records by???
I have a database with records and within this I have a field based on the date the record was created. How can I perform a find to automatically... -
How to find duplicate records in the table?
I have a table with following columns: Part_nbr Desc QOH Price I want to make sure there is no duplicate part numbers and if there is and I... -
mxstu #2
Re: find last two records
One way is to sort the records by the date column in DESCending order, so the
most recent are listed first. Then grab the first 2 rows. I don't know the
exact syntax, but look in your documentation for the LIMIT command. It should
be something like this
--- NOT tested
SELECT t1.SomeColumn, t1.SomeOtherColumn
FROM table1 t1 INNER JOIN table2 t2 ON t1.CommonColumn = t2.CommonColumn
ORDER BY t1.yourDateColumn DESC
LIMIT 2
mxstu Guest



Reply With Quote

