-1

I am receiving Error Code: 1060 Duplicate column name 'fsu_id' in the attached view that I am trying to create even the field names are pre-fixed.

I am creating the view using tool called SQLyog.

The tables bkd and rcs are actually views I have previously created.

CREATE
/*[ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
[DEFINER = { user | CURRENT_USER }]
[SQL SECURITY { DEFINER | INVOKER }]*/
VIEW `arab_cargo_fsu`.`rcs_after_bkd` 
AS
(SELECT
`bkd`.`fsu_id`
, `bkd`.`msg_id`
, `bkd`.`msg_date_time`    
, `rcs`.`fsu_id`
, `rcs`.`msg_id`
, `rcs`.`msg_date_time`        
FROM
`arab_cargo_fsu`.`bkd`
LEFT JOIN `arab_cargo_fsu`.`rcs` 
    ON (`bkd`.`pfx` = `rcs`.`pfx`) AND (`bkd`.`awb` = `rcs`.`awb`));
HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
Malcolmf
  • 75
  • 8

1 Answers1

0

You can't have a view/table where columns have the same name. Use aliases

SELECT bkd.fsu_id as bkd_fsu_id,
       ...
       rcs.fsu_id as rcs_fsu_id
       ...
juergen d
  • 201,996
  • 37
  • 293
  • 362