-2

Is it possible to use "select into" statement when we are joining different tables which have 1 or more same column names? Eg: Table1 has column name as description and Table2 has column name as description and I want both these columns data in my new table

Paul White
  • 94,921
  • 30
  • 437
  • 687

1 Answers1

2

It's possible on most database systems, but you can't have 2 columns with the same name -- so you would have to rename one of them, e.g.

Select
a.Field1,
a.Field2,
b.Field2 as NewFieldName,  -- using an alias
b.Field3
INTO...

Notice in this example, both table 'a' and 'b' have a column Field2.

seventyeightist
  • 1,039
  • 6
  • 8