SELECT DISTINCT p.id AS id, p.precio AS precio, p.autor AS autor FROM producto AS p JOIN producto_categoria AS pd ON( p.id = pd.producto_id) JOIN producto_detalle AS pdd ON ( p.id = pdd.producto_id ) WHERE pd.categoria_id = '2'GROUP BY p.idasdasd