I have a problem that has frustrated me for days, I am developing a DB in SQL with the structure of the image, I explain a little:
Each "Completed Part" has several "Parts of Blanquins" and in turn each "Blanquin Part" has several "Stamped Parts", these last two tables are related to other tables as shown in the image, especially with " Dies "and" Operation Condition ", although each one has a different value (one is related to a die and the other to a different one).
The problem is that I want to make a query to show all the "Blanquin Parts" and the "Stamped Parts" both in the same column, I have a query but only shows one or the other
I hope you can help me, Thanks ...
I leave the code of my query:
select ltrim (Rtrim(numero_parte)) as 'Parte Terminada',
nombre_parte as 'Nombre PT', np.numero as 'Parte Estampada',
np.nombre as 'Nombre', modelo as 'Modelo', proveedor as 'Proveedor',
cliente as 'Cliente',
np.centro_trabajo as 'Centro De Trabajo',
np.imagen as 'Imagen', proceso as 'Proceso',
nombre_proceso as 'Nombre Del Proceso', colchon as 'Colchon',
linea as 'Linea', prensa as 'Prensa',
np.linea_contin as 'Linea De Contingencia', almacen as 'Almacen',
FROM partes_terminadas pt inner join numero_parte np on
np.id_partermi=pt.id
left join partes_estampadas pe on pe.id_bl=np.id
left join troquel tro on pe.id_troq=tro.id
left join linea li on tro.id_linea=li.id
left join condicion_operacion co on pe.id_co=co.id
left join material mat on np.id_material=mat.id