Avatar of yossikally
yossikally
 asked on

"select into" from joined tables

This must be a very simple question if you have any real experience (obviously I don't)
I have:
  t_player table
  tk_playerTeam table

I want to select records from t_player into t_temp, but only if they do not belong to any team.
So I came up with the following:

select * into t_temp from t_player p
left join tk_playerTeam pt on pt.playerID = p.playerID
where pt.teamID is null

on which I get:
"Column names in each table must be unique...."
I don't want to specify each field from t_player.  All t_player fields must be replicated to t_temp
Microsoft SQL ServerMicrosoft SQL Server 2005SQL

Avatar of undefined
Last Comment
yossikally

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Aneesh

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
yossikally

ASKER
that was quick. thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23