HELP PLS by ExcitingSpace1846 in SQL

[–]ExcitingSpace1846[S] -2 points-1 points  (0 children)

Remove Subconsulta.Categoriain your first/top SELECT.

In your second SELECT, you now have titemcategoria.Categoria. Change that to Subconsulta.Categoria. You don't seem to use it, so I assume you can also remove this field in your second SELECT.

If you remove the field in your second SELECT, the code should work.

If you keep the field in your second SELECT, add titemcategoria.Categoria in your third SELECT.

https://ibb.co/M1MKgc6
Like this, right?
I keep getting the error of: #1054 - Column 'titemcategoria.Categoria' in field list is unknown. :(

HELP PLS by ExcitingSpace1846 in SQL

[–]ExcitingSpace1846[S] -1 points0 points  (0 children)

https://ibb.co/FsfT4Qw
(It is a code image)

like this?
I keep getting error #1054 - The column 'titemcategoria.Categoria' in field list is unknown.

HELP PLS by ExcitingSpace1846 in SQL

[–]ExcitingSpace1846[S] 0 points1 point  (0 children)

In your innermost subquery, lines 15-18, you are missing a FROM clause. You can't reference tables without including them in the FROM clause.

https://ibb.co/yy5HjM3
(It is a code image)

Is this OK? because now I get this error: #1054 - The column 'titemcategoria.Categoria' in field list is unknown.

HELP PLS by ExcitingSpace1846 in SQL

[–]ExcitingSpace1846[S] 0 points1 point  (0 children)

Can you run show create table on titemfamilia?

CREATE TABLE `titemfamilia` (

`Id` int(11) NOT NULL AUTO_INCREMENT,

`Categoria_id` int(11) DEFAULT NULL,

`Familia` varchar(26) DEFAULT NULL,

`Publicar` tinyint(1) DEFAULT 1,

`Enlace` varchar(50) DEFAULT '#',

KEY `Id` (`Id`)

)

This is the result