ibgadmin
asked on
SQL select into query
Can someone help with what is wrong with my syntax below on my SQL statement? I get Error: Column names in each table must be unique. Column name 'CUSTEDP' in table 'IBGTEMP_ACCTCOMM_BACKUP' is specified more than once. (State:S0021, Native Code: A91) I'm trying to backup select records from ACCTCOMMENTS table into a backup table called IBGTEMP_ACCTCOMM_BACKUP.
SELECT * INTO IBGTEMP_ACCTCOMM_BACKUP
FROM ACCTCOMMENTS ACMT
INNER JOIN STANDINGHEADER STHD
ON ACMT.CUSTEDP = STHD.CUSTEDP
WHERE STHD.CUSTEDP=ACMT.CUSTEDP AND ACMT.TYPE='SO'
SELECT * INTO IBGTEMP_ACCTCOMM_BACKUP
FROM ACCTCOMMENTS ACMT
INNER JOIN STANDINGHEADER STHD
ON ACMT.CUSTEDP = STHD.CUSTEDP
WHERE STHD.CUSTEDP=ACMT.CUSTEDP AND ACMT.TYPE='SO'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did it Leo, thanks so much
You can have the new table have columns with the same names I would name them something else when you explicitly write them