I am trying to write a view and have a column that looks for a value in a column, if it finds it then, move onto the next etc...
When it finds the value it is looking for I want it to return the value contained in another column.
Type 1, Type 2, Type 3, Type 4, Detail 1, Detail 2, Detail 3, Detail 4
So it looks for a value in the Type column, when it finds it, it moves on to the next Type. When it doesn't find the value, it returns the Detail column. If it finds the value in all columns, then it returns "All" or some such.
I can work it out in Excel, but I'm new to SQL Server 2005 so it is a bit of a battle.