1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Sql Duplicate Value Primary Key

Discussion in 'Databases' started by ironmankho, Feb 9, 2013.

  1. #1
    hi
    every one i want to enter duplicate value in primary key mysql .......is there solution ?
    Solved! View solution.
    ironmankho, Feb 9, 2013 IP
  2. #2
    No you can't enter the duplicate value in primary key.
    icecube media, Feb 11, 2013 IP
  3. TestingWhiz1

    TestingWhiz1 Member

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #3
    Primary key is a unique key id in any relation.And there would be one and only one primary key in a relation.
    TestingWhiz1, Feb 15, 2013 IP
  4. worldart

    worldart Banned

    Messages:
    26
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    28
    #4
    If you want to enter duplicate value then you cannot set it as primary key, primary key is a unique key so either you should have it unique or dont declare it as a primary key
    worldart, Feb 19, 2013 IP
  5. kulik

    kulik Member

    Messages:
    162
    Likes Received:
    18
    Best Answers:
    1
    Trophy Points:
    45
    #5
    The whole purpose of the primary key is not to have duplicates and can't. You should be more specific in what you want to do. Why would you ever want multiple ID's of the same value?
    kulik, Feb 19, 2013 IP
  6. traxport121

    traxport121 Active Member

    Messages:
    1,209
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    63
    #6
    If you want to add duplicate value in it, remove it as a primary key first. Go to the design view of your DMBS and delete the PK.
    traxport121, Mar 2, 2013 IP
  7. jiah

    jiah Greenhorn

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #7
    Noone enter a dublicate value in primary key in sql
    jiah, Mar 15, 2013 IP