Db Design for Matrix Lookup
am 04.06.2007 04:24:54 von SteveB
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 ***
Re: Db Design for Matrix Lookup
am 04.06.2007 09:23:13 von Erland Sommarskog
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@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx
Re: Db Design for Matrix Lookup
am 05.06.2007 02:33:51 von SteveB
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 ***