视图中的类型转换问题
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER view v_Mmtying as
SELECT
Ming.*,
[suc] = (
SELECT count(*) FROM [Mmtyed] Med
where Med.[mmtying_id] = Ming.[ID_Mmtying]
and sent = 1 and time_go is not null),
[fmty] = (
SELECT count(*) FROM [Mmtyed] Med
where Med.[mmtying_id] = Ming.[ID_Mmtying]
and sent = 0 and time_go is not null),
[total] = (
SELECT count(*) FROM [users] U
where U.[state] in (Ming.[mSQL])
) --其中(Ming.[mSQL])为VARCHAR,值类似'2,3,4',但是执行说转换为int出错,怎么解决?
FROM [Mmtying] Ming