我想转换值
2to5experience
3to7experience
到Minexperience:
2
3
最大经验
5
7
所以我创建了以下查询,
select cast(substring(Cast(Experience AS VARCHAR(50)),1,1)*365*24*60*60 as int) as Experience
from requirementsdetailsfororganization
上面的一个正在工作。当我更新如下查询时,出现错误。
select 'Insert into Jobs(requirementId,organizationId,Minexperience)values(' +
Cast(o.RequirementID as varchar(50))+',' +
Cast(o.OrganizationID as varchar(50))+',' +
cast(substring(CAST(Experience AS VARCHAR(50)),1,1)*365*24*60*60 as int)+')'
FROM RequirementsDetailsforOrganization AS o
它显示错误
“将 varchar 值')' 转换为数据类型 int时转换失败”
任何的想法?