I have this sentence:
SELECT registro_vehiculo.fecha_entrada, persona.nombre,tipo_servicio.tipo_servicio
FROM registro_vehiculo,persona,tipo_servicio
INNER JOIN tipo_persona ON tipo_persona.id_tipop=persona.tipo
WHERE registro_vehiculo.fecha_entrada >= '2017-01-01'
AND registro_vehiculo.fecha_entrada <='2017-04-20'
ORDER BY registro_vehiculo.fecha_entrada ASC
and this error marks me
MySQL has said:
# 1054 - The column 'person.type' in on clause is unknown
Does anyone know the reason for the error?
The structure of my "person" table is this:
create table persona (
id_persona int not null,
tipo int not null,
nombre varchar (20) not null,
apellidos varchar (30) not null,
telefono char(15) not null,
direccion varchar (25) not null,
correo varchar (30) not null,
rfc varchar (20)not null,
primary key(id_persona),
index pers_tipo(tipo),
foreign key (tipo) references tipo_persona(id_tipop));
and the table "type_person" is:
create table tipo_persona (
id_tipop int,
primary key(id_tipop) ,
tipo_persona varchar(10) not null);
As you can see, I do have a foreign key in my "person" table.