Is there any way I can do a join between two tables where the resulting table has only the columns of the left table without the need to discriminate all the columns names in the select?
+2
A:
You can do this:
Select LeftTable.*
From LeftTable
Inner Join RightTable
On LeftTable.Id = RightTable.Id
Raj More
2009-11-04 15:44:02
Beat me by 3 seconds :-)
Dani
2009-11-04 15:44:52
This works, but be aware that if this query is part of a view, any new columns added to LeftTable will not be selected by the view until the view is recompiled. (at least I've observed this behavior in MS SQL Server)
Michael Petito
2009-11-04 15:50:02
A:
You mean something like
Select t1.id, t1.name, t1.age FROM t1 INNER JOIN t2 ON t1.id = t2.id
WHERE t2.Something = Something
Pace
2009-11-04 15:45:40