Re: selecting records newer than say 20 min

2006-03-07 Thread Marco Simon
select * from table where mytimestamp  (unix_timestamp - 20) ??

Gregory Machin schrieb:
 Hi
 What, is the easest way to select all the records created in the last 20 min
 stay based on a column that has a timestamp record.

 Many Thanks

 --
 Gregory Machin
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 www.linuxpro.co.za
 www.exponent.co.za
 Web Hosting Solutions
 Scalable Linux Solutions
 www.iberry.info (support and admin)

 +27 72 524 8096
   


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: selecting records newer than say 20 min

2006-03-07 Thread Косов Евгений

Hi, Gregory

Hmm.. I think you just should add something like 'create_time  
DATE_SUB(NOW(), INTERVAL 20 MINUTE)' to a where clause of your query. Or 
something similar..


You can find more at 
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html.


Also consider creating of an index on your timestamp field, if your 
table is large.




Hi
What, is the easest way to select all the records created in the last 20 min
stay based on a column that has a timestamp record.

Many Thanks

--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)

+27 72 524 8096


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: selecting records newer than say 20 min

2006-03-07 Thread Martijn Tonies
Hello Gregory,


 What, is the easest way to select all the records created in the last 20
min
 stay based on a column that has a timestamp record.

select * from mytable
where some_timestamp  date_add(current_timestamp, interval -15 minute)

Martijn Tonies
Database Workbench - development tool for MySQL, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: selecting records newer than say 20 min

2006-03-07 Thread Gregory Machin
Hi
Thanks for you support hope you have a grate day ..

On 3/7/06, Martijn Tonies [EMAIL PROTECTED] wrote:

 Hello Gregory,


  What, is the easest way to select all the records created in the last 20
 min
  stay based on a column that has a timestamp record.

 select * from mytable
 where some_timestamp  date_add(current_timestamp, interval -15 minute)

 Martijn Tonies
 Database Workbench - development tool for MySQL, and more!
 Upscene Productions
 http://www.upscene.com
 My thoughts:
 http://blog.upscene.com/martijn/
 Database development questions? Check the forum!
 http://www.databasedevelopmentforum.com




--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)

+27 72 524 8096