Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2012

    Unanswered: Associate values in the same table column

    Hello guys, i'm not one expert with DB and i have a problem here.

    I have a table with 3 columns, ID, Title and Value, thing is that the ID is never the same for every record, the value have values like "Name" and "Mail", and the Value column have the names and emails, so i want to associate the name and email in the Value column, but with my query i got something like this:

    ID | Title | Value

    1 | Name | John Doe
    2 | Email |
    3 | Name | Peter
    4 | Email |

    i need a query that gives me something like this:

    Name | Email
    John Doe |
    Peter |

    can anyone help me?

    Best regards.

  2. #2
    Join Date
    Mar 2004
    Look up Entity, Attribute, Value. it is the table design that you currently have and is very difficult to query compared to normalizing your data.

  3. #3
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    You appear to have at least the Attribute and Value part of an EAV (Entity, Attribute, Value) table. This is one of the most difficult and inefficent ways to store data in a relational database... It is easy to code and put data into the database, but practically impossible to get the data back out efficiently.

    If you know exactly what rules were used to put the data into this table, then you can possibly get the data back out. Without knowing those rules and every detail of absolutely every exception, the data is just a pile without order or value.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

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