SELECT DISTINCT p.id AS id, p.precio AS precio, p.autor AS autor FROM producto AS p JOIN producto_categoria AS pd1 ON( p.id = pd1.producto_id AND pd1.categoria_id = '24' ) JOIN producto_categoria AS pd3 ON( p.id = pd3.producto_id AND pd3.categoria_id = '44' ) JOIN producto_detalle AS pdd ON ( p.id = pdd.producto_id )GROUP BY p.idasdasd