I am having a few issues with some code and wanted some guidance ;
I am creating a view based on a table, and need to create a "Identify" column, based on the data in the table ;
Simple - 3 columns
StockCode, MorB, Warehouse
StockCode, MoRB, ,Warehouse,
WHEN Warehouse = 'CC' then 'Cars'
WHEN MorB = 'B' then 'Bought'
WHEN Warehouse = 'AA' then 'Available'
I would hope to see the following;
My question is; Do I understand the CASE logic correctly and does it do one condition and then drop to the CASE...END statement after satisfying one of the conditions? or does it do EVERY CASE WHEN check and hold the last one as the description ?
SQL 2008 DBA/DBD - MCTS/MCITP
Please don't trust me, test the solutions I give you before using them.