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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:36:08+00:00 2026-05-31T20:36:08+00:00

I have a table: event_list with two columns: name as var(80) and default as

  • 0

I have a table: event_list with two columns: name as var(80) and default as ENUM(‘y’,’n’).

The idea is that there can only be one event set as default at a time. So if there are 100 events in the table 99 of them must have a default value of ‘n’ and one must have a default value of ‘y’.

When a customer is adding a new event to the system there is a option “Make This Event Default”. What I want to do is insert the event into the table. If the default column for that insert is added as ‘y’ I need a easy way of changing all the rest of the default rows to ‘n’.

Is there a way for mySQL to handle this or will I have to manually change all the other data fields to ‘n’ if the user makes a new default?

  • 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-31T20:36:09+00:00Added an answer on May 31, 2026 at 8:36 pm

    I would suggest altering your current table to include an ID (unique, autoincrement) field, and removing the enum field, and then adding a new table that stores the ID of default event. Then you only need to edit one line.

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

Sidebar

Related Questions

i have a table that has event name and event date. if i want
I have a table with a column event_time . How can I select two
I have two entities one is Event and another is User. User can like
I have two entities: Event and Comment. @Entity @Table(name = events) public class Event
I have a table called Event. A column has duration--which is...how long that event
I have a table that functions as an event log and stores the users
I have 3 tables event, location, event_location. Event can have multiple locations. Location table
So I have a parent that defines a onmouseup event that hide/display a table.
I have two radiobuttonlist and one checkboxlist on the page. Ideally based on the
I have two tables containing three columns containing the same types of information(id, attributes,

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.