I have a table A which needs to join table B.
table B is a constant which 2 columns
year, flag
----------
2010, A1
2011, A2
2012, A3
2013, A4
2014, A5
is it possible to do something like below (* invalid syntax in sql server, just use it to show what I mean):
SELECT *
FROM A RIGHT JOIN (
2010, 'A1';
2011, 'A2';
2012, 'A3';
2013, 'A4';
2014, 'A5';
)
B ON A.year = B.year
I do not want to use table variable or temp table for B. Is there other choices?
Thanks