Create FUNCTION get_qp_detail
(
@Id varchar(100)
)
RETURNS varchar(2000)
AS
BEGIN
declare @Str varchar(2000)
set @Str = ''
select @Str = @Str + [fileno] from test
where [wo_no] = @Id
return @Str
END
GO
SELECT wms_sa.getit(wo_no) Qp_Detail FROM wms_sa.wo_qp group by wo_no