I'm trying to
CROSS JOIN a table with a view. Here is my code:
SELECT * FROM ( SELECT * , CASE TypeId WHEN 1 THEN InGs828S WHEN 2 THEN InGS828H WHEN 3 THEN InGS828L WHEN 4 THEN InEasyFlowWD END AS InDevice FROM dbo.Ports ) tempTable CROSS JOIN dbo.vwDevices WHERE InDevice=1
Msg 207, Level 16, State 1, Line 4 Invalid column name 'TypeId'.
TypeId is a column in view
My question is why can't I use any columns from
CASE *ColName*, while I can use columns from table