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 7801277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:53:50+00:00 2026-06-02T00:53:50+00:00

Am really new to Mysql. Is it possible to do something like the following

  • 0

Am really new to Mysql. Is it possible to do something like the following in some way? Mysql throws a syntax error as expected but is there something that I should change that would make it work?

CREATE TABLE tracksession(ID INT NOT NULL AUTO_INCREMENT,
             user_id INT DEFAULT NULL,
             leave_mode ENUM('loggedout', 'timedout') DEFAULT NULL,
             login TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
             logout TIMESTAMP DEFAULT ADDDATE(CURRENT_TIMESTAMP, INTERVAL 20 MINUTE),
             PRIMARY KEY(ID));

Thanks in advance.

  • 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-02T00:53:52+00:00Added an answer on June 2, 2026 at 12:53 am

    Nope you cannot do this

    DEFAULT ADDDATE(CURRENT_TIMESTAMP, INTERVAL 20 MINUTE),
    

    explanation from the manual :

    The DEFAULT value clause in a data type specification indicates a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression.

    Must be a constant not a function …

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

Sidebar

Related Questions

I'm new to MySQL so I really need some help with an issue I'm
Being really new to wx, I'm wondering if there is an IDE (especially for
im really new to linq-to-SQL so this may sound like a really dumb question,
Hi I'm really new to php/mysql. I'm working on a php/mysql school project with
So I'm really really really new to PHP and MySQL (just started today!). I
this questions looks really easy but I'm a noob in C++ and MySQL so
im really new to flash, how do i go about creating a variable which
I'm really new to the Facebook API and am having trouble getting the Facebook
So I am really new to cocoa programming. In fact I am very new
I am really new to C++ programming so please pardon my silly question. I

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.