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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:30:31+00:00 2026-06-04T12:30:31+00:00

How do I make it so 2 columns cannot have the same data. My

  • 0

How do I make it so 2 columns cannot have the same data. My table consists of 3 fields.

studentid    id_project     level_of_want
1            2                high
1            3                low
1            4                high
1            2                low

I want is so that one column can have the same data (eg 1 in studentid) but the studentid and id_project cannot have the same data more than once (enties 1 and 4 above). studentid can be 1 and id_project can be 1, but this can only happen once.

  • 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-04T12:30:34+00:00Added an answer on June 4, 2026 at 12:30 pm

    You need to add an “unique” index.

    Read http://dev.mysql.com/doc/refman/5.0/en/create-index.html

    create unique index my_index on my_table (studentid, id_project);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a unordered list that I want to make fill 2 columns, I
I want to have a database table that keeps data with revision history (like
I have four tables containing exactly the same columns, and want to create a
I am tring to make two columns having same height but failed. How to
I want to iterate through store and make grid columns dynamically. When I use
I have my own simple equal heights code in jQuery to make two columns
I have a database with the columns: id, pdate, pvalue1, pvalue2. First I make
I have a static 2D array called Status.Data[][] and a Column header called Status.Columns[]
i have a GridView bound to a DataView. Some columns in the DataView's table
I have table named 'Dictionary' with columns as follow: ID bigint TYPE varchar (200)

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.