I know this will cause an ambiguous error since Name exists in both tables. But
I want to select the Name from these two tables. Name is a column in t_1 and t_2. Is it possible to select from two tables? Is there a way for me to select the name between two tables, and returns a single column of data?
FROM t_1, t_2
WHERE Name LIKE '%' + @USER + '%'
You could try a
SELECT Name FROM t_1 WHERE Name LIKE '%' + @USER + '%' UNION SELECT Name FROM t_2 WHERE Name LIKE '%' + @USER + '%'
UNION ALL can also be used, this will also return multiple instances of the same name if they exist. Use whichever satisfies your requirements.