Hey, I have this query in PL/SQL:
--Ver todos los atributos de las OL de una OS.
SELECT attr.swspattrdataid attr_data_id,
att.swname attribute_swname,
attr.swvalue attr_data_swvalue
FROM sw_sp_attr_data attr,
sw_sp_attribute att
WHERE swobjectid IN (SELECT swsporderlineid
FROM sw_sp_order_line
WHERE swsporderid = 21444963 --Orden
**AND swsporderlineid = a_number**
);
AND att.swspattributeid = attr.swspattributeid
--AND att.swname LIKE '%%' --Filtrar por nombre
I need to have the AND filter between ** to be optional, so no matter if I put a number there the query runs OK, is this posible?
Thanks!