SELECT CASE WHEN (t1.service_number IS NOT NULL AND t1.option_number IS NOT NULL
AND t1.component_number IS NOT NULL)
THEN t1.line_number
|| '.'
|| t1.shipment_number
|| '.'
|| t1.option_number
|| '.'
|| t1.component_number
|| '.'
|| t1.service_number
WHEN (t1.service_number IS NOT NULL AND t1.option_number IS NOT NULL AND
t1.component_number IS NULL)
THEN t1.line_number || '.' || t1.shipment_number || '.' || t1.option_number || '..' || t1.service_number
WHEN (t1.service_number IS NOT NULL AND t1.option_number IS NULL AND t1.component_number IS NOT NULL)
THEN t1.line_number || '.' || t1.shipment_number || '..' || t1.component_number || '.' || t1.service_number
WHEN (t1.service_number IS NOT NULL AND t1.option_number IS NULL AND t1.component_number IS NULL)
THEN t1.line_number || '.' || t1.shipment_number || '...' || t1.service_number
WHEN (t1.service_number IS NULL AND t1.option_number IS NOT NULL AND t1.component_number IS NOT NULL)
THEN t1.line_number || '.' || t1.shipment_number || '.' || t1.option_number || '.' || t1.component_number
WHEN (t1.service_number IS NULL AND t1.option_number IS NOT NULL AND t1.component_number IS NULL)
THEN t1.line_number || '.' || t1.shipment_number || '.' || t1.option_number
WHEN (t1.service_number IS NULL AND t1.option_number IS NULL AND t1.component_number IS NOT NULL)
THEN t1.line_number || '.' || t1.shipment_number || '..' || t1.component_number
ELSE t1.line_number || '.' || t1.shipment_number END so_line#
FROM OE_ORDER_LINES_ALL t1
Thursday, April 7, 2011
Subscribe to:
Posts (Atom)