Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
hi all,I'm new to SQL Server, have been using Oracle.I can't seem to find a way to alias the resulting columns of joined tables. In oracle this is damn easy.select joined_tables.*from (tableA inner join tableB on tableA.tableB_ID = tableB.ID) joined_tables;I can only alias both tables in the join which does nothing. How do you alias the result of the join????Thanks.
ehorn
Master Smack Fu Yak Hacker
1632 Posts
Posted - 2004-07-06 : 19:55:17
In SQL Server you use a derived table:
SELECT c.*FROM( SELECT a.col1,a.col2,a.colN, b.col1,b.col2,b.colN FROM tableA a INNER JOIN tableB b on b.colN=a.colN) c