I have a view
The document_id column has this type of data W~WO1~lot1~split1~sub2~opr
I would like to make 6 columns, naming them type,base,lot,split,sub and opr.
Can this be done when creating a view?
Code:
CREATE view
[dbo].[AGV_WO_OPR_AND_UDFS]
as
SELECT [PROGRAM_ID] as id
,[DOCUMENT_ID] as doc
,case when [id] = 'UDF-0000086' then [string_val] else null end as Machine
,case when [id] = 'UDF-0000087' then [string_val] else null end as Prog_Ready
,case when [id] = 'UDF-0000088' then [string_val] else null end as Kit_Ready
FROM [Serials].[dbo].[USER_DEF_FIELDS]
where [program_ID] = 'VMMFGWIN_OP' AND [DOCUMENT_ID] IS NOT NULL
GO
I would like to make 6 columns, naming them type,base,lot,split,sub and opr.
Can this be done when creating a view?