SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2002
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Column type question:

    if i want to store more than one ID in a column, which is the best column type to use? my investigation tells me it might be SET but i'm not sure.

    any helpers?

  2. #2
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    personally I don't think I would try and place more than 1 ID in a single column.. can you maybe explain why? as changing the dB design might be the better task, but I won't know until I understand why you want this.

    But if you are happy that a dB change isn't the way to go then yes SET seems to be the right way to go..

    Sarah
    Regular user

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The short answer is a SET where you seperate each value by a comma. The long answer is that this is bad relational database design. One of the simple rules of data normalisation is that each attribute should be atomic. That is a "column" should hold a singe value. There are many reasons for this - that is why we have the rules of data normalisation - they help us create a data model that can be interegated with integrity using SQL.

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to a more appropriate forum

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •