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.
| Author |
Topic |
|
Mooo0
Starting Member
4 Posts |
Posted - 2008-04-23 : 21:57:40
|
| Hello all,I am using INNER JOIN to connect 2 tables together but I wish it to return distinct columns instead of repeating itself !eg.Current output would be:UserID Name UserID OrderID1 John 1 52 Bob 2 6I want it to be:UserID Name OrderID1 John 52 Bob 6I need to use SELECT * as there are many many columns and wish to save time :)Cheers,James |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-04-23 : 22:03:14
|
| So what you mean? Do you have table with duplicate column name? |
 |
|
|
Mooo0
Starting Member
4 Posts |
Posted - 2008-04-23 : 22:09:55
|
| Ahh yes, should have mentioned the tables that I am using:Tables I'm using might look like thisTableAUserID NameTableBUserID OrderIDand I am getting duplicate columns when I use INNER JOIN together |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-23 : 23:50:36
|
| There is no other way but to specify only the columns that you require in select list. Using select * selects all the columns from tables involved and you will get same column repeated from different tables. |
 |
|
|
|
|
|