Hi all,
Happy Friday and with that I have a brain teaser that hopefully can be solved!
I have a database in which one column that is numerically filled correlates to values in another column so that for example when:
cd_number=1 cd_value=lastname (jones, smith, etc etc)
cd_number=2 cd_value=firstname (Larry, Steven)
cd_number=45 cd_value=wound_class (1,2)
etc etc
so my question is,
when I write my sql query I want it so that:
select cd_value as lastname (when cd_number=1), cd_value as firstname (when cd_number=2), cd_value as wound_class, etc etc
I have tried different iterations including select x, (select a.cd_value from x.table when when cd_number=1) as lastname, b, c from ...
However it does creates an error if I attempt it, this way.
Any suggestions?
Thank you.
Lawrence Block
... View more