I want to join two tables (each table has 200 columns) so the purpose of this is to have a table with 400 columns, but how do I get the result without the primary key?
id a1 a2 a3 ... a200
-----------------------
1 23 4 5 7
2 24 6 8 17
3 13 14 52 73
...
id b1 b2 b3 ... b200
-----------------------
1 53 14 15 87
2 64 16 18 87
3 73 74 12 83
...
So the sesult I want is like
a1 a2 a3 ... a200 b1 b2 b3 .... b200
--------------------------------------
23 4 5 7 53 14 15 87
24 6 8 17 64 16 18 87
13 14 52 73 73 74 12 83
...
I have this
SELECT * a as T1 join b as T2 on T1.id=T2.id;
There is no way to say
SELECT (* EXCEPT some_col), sorry. However, it is quite easy to generate the list by dragging the “Columns” node for each table from Object Explorer onto the query window, and then simply remove the PK columns from the list. Click on the Columns node for a view or table, then drag it onto the query window:Voila!