0

Hi guys!
please tell me - where is error here -

select `OWNER.OWNER_ID`, `Previous_owner.GDATE`  from `Previous_owner` left join `OWNER` on
 `Previous_owner.OWNER_ID`=`OWNER.OWNER_ID` 
 left join `AVTO` on `Previous_owner.OWNER_ID`=`AVTO.OWNER_ID`  where `AVTO.AVTO_ID` = 3

phpmyadmin shows error -

#1054 - Unknown column 'OWNER.OWNER_ID' in 'field list'

the db structire is =

create table AVTO
(
  AVTO_ID   INT not null AUTO_INCREMENT PRIMARY KEY,
  MARKA VARCHAR(100),
  KN INT,
  DN INT,
  OWNER_ID INT
);
create table OWNER
(
  OWNER_ID INT not null AUTO_INCREMENT PRIMARY KEY,
  NAME VARCHAR(100),
  UN INT
);
create table Previous_owner
(
  OWNER_ID INT ,
  AVTO_ID INT,
  GDATE  TIMESTAMP
);

big thanks in advance!))

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by vedro-compota
1

Erase all back-ticks.
`OWNER.OWNER_ID` is interpreted as a field name, not as a table- plus field name.
Or code `OWNER`.`OWNER_ID` (urrhg)

Votes + Comments
+++++++++++
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.