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

  • Home
  • SEARCH
  • 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 7837259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:32:45+00:00 2026-06-02T14:32:45+00:00

I have many columns like this: select when from t1 where when LIKE ‘2002-01-02

  • 0

I have many columns like this:

select when from t1 where when LIKE '2002-01-02 %'\G
*************************** 1. row ***************************
when: 2002-01-02 02:13:14
*************************** 2. row ***************************
when: 2002-01-02 02:15:31
*************************** 3. row ***************************
when: 2002-01-02 02:19:42

I am trying to increment the date and time with 10 years, 3 month, 22 days, and 13 hours, 10 minutes, so that it will look something like:

2012-04-24 15:23:14
2012-04-24 15:25:31
2012-04-24 15:29:42

Searched and found ways ( ADDDATE ) to increase either only the year, or month … but how can I do for all the year, month, date, and time ?

If it can be done in a single query it would great, but anything is fine .. Thanks for your time.

  • 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-06-02T14:32:52+00:00Added an answer on June 2, 2026 at 2:32 pm

    You can use something like this –

    SELECT datetime + INTERVAL 10 YEAR + INTERVAL 3 MONTH + INTERVAL 22 DAY
           + INTERVAL 10 HOUR + INTERVAL 30 MINUTE AS new_date_time FROM table
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user table that has many columns, it looks roughly like this:
I have a query that always returns one row, with many columns. I would
I have a table of product information with many bit columns. This table can
I have read many article about this one. I want to hear from you.
I have a query that looks something like this: select xmlelement(rootNode, (case when XH.ID
I have a table called items. IN this table there are many columns. One
I am trying to run this query: $record = Doctrine_Query::create() ->select('m.*') ->from('Modification m') ->leftJoin('m.Location
I have a table structure that looks like this: Columns: Account Number Service Code
I have two columns. People have to select elements from the first column and
I have a database with many columns and sometimes I need to select quite

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.