Db Design for Matrix Lookup

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben

    Db Design for Matrix Lookup


    Hi All,
    I have to update a column in Table A based on 3 other columns in Table A
    itself. I have an excel matrix like so


    Column2-Value1 Column3-Value1 Column2-Value2

    Column1-Value1 A B C
    Column1 - Value2 V W X


    and so on.. I am not able to think of a smart way to design this other
    that the case statements?

    Any help is appreaciated.
    Thanks



    *** Sent via Developersdex http://www.developersdex.com ***
  • Erland Sommarskog

    #2
    Re: Db Design for Matrix Lookup

    Ben (nospam@devdex. com) writes:
    I have to update a column in Table A based on 3 other columns in Table A
    itself. I have an excel matrix like so
    >
    >
    Column2-Value1 Column3-Value1 Column2-Value2
    >
    Column1-Value1 A B C
    Column1 - Value2 V W X
    >
    >
    and so on.. I am not able to think of a smart way to design this other
    that the case statements?
    It's not clear to me what the rules for the update are. For this kind of
    question, it's always a good idea that you post:

    o CREATE TABLE statement for your table.
    o INSERT statements with sample data.
    o The desired result given the sample.

    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server 2005 at

    Books Online for SQL Server 2000 at

    Comment

    • Ben

      #3
      Re: Db Design for Matrix Lookup



      Thanks for responding Erland, I figured it out finally, will post sample
      scripts and solutions soon.


      Thanks all.

      *** Sent via Developersdex http://www.developersdex.com ***

      Comment

      Working...