Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6073123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:14:10+00:00 2026-05-23T10:14:10+00:00

I have this table on my MySQL server: id name url type ut lastcheck

  • 0

I have this table on my MySQL server:

id      name    url     type    ut      lastcheck
1       Name1   url1    1       5       2011-06-28 12:21:46
2       Name2   url2    1       10      2011-06-28 12:21:46
3       Name3   url3    1       12      2011-06-28 12:21:46
4       Name4   url4    1       1       2011-06-28 12:21:46

ut means update time, in minutes. I want to develop a script using MySQL commands that retrieves me only the elements that complains this statement:

NOW() – lastcheck=>ut

I’m developing in php and I know how to do this retrieving all the elements and then using simple php operations to filter the elements I need, BUT I don’t want any more load in my script. So I want my MySQL server to do all the work but I have no idea how to build the SQL query to do this.

I know that MYSQL can make difference between dates using SELECT TIMEDIFF(NOW(), '2010-11-26 12:00:00'); for example.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:14:11+00:00Added an answer on May 23, 2026 at 10:14 am

    If I have understood correctly, you need to select the rows where the number of minutes since the last check is greater than ut?

    You should be able to use the TIMESTAMPDIFF command for that:

    SELECT * FROM table WHERE ut < TIMESTAMPDIFF(MINUTE,lastcheck,NOW());
    

    The TIMESTAMPDIFF command allows you to specify the units that you wish to be output so it should give you exactly what you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL table structured somewhat like this: type name value ===================== 1
I have this mysql table called comments which looks like this: commentID parentID type
Let's say I have this MySQL table: OK.. see the type field? Type 0
I have this kind of mysql db (table name/fields) tbl_users : id, title, approved
I have this MySQL table: video (id int, name varchar(30), view_count int) I tried
i have a t_class table in mySql, in this table there are 3 columns,
I have this in a MySQL db: table Message sender_id int recipient_id int created
Let's say I have a MySQL table that is something like this: software table:
I have a MySQL table like this: Payments +----+---------------------+---------+ | id | date (sorted
I have a MySQL table looking like this: > describe books; +---------------+--------------+------+-----+---------+----------------+ | Field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.