Erro de Syntax

MySQL

02/05/2018

Pessoal,
Elaborei uma consulta no MySql porém apresentou um erro.
SELECT * FROM lvetm.v_tb_toa substring("NumOrdem" FROM position(''-'' in "NumOrdem") + 1 for length("NumOrdem") - position(''-'' in "NumOrdem")),
"NumOrdem", "DT_HR_Fech", "TipoAtiv", "Provedor", "Estado", "Endereco" where "DT_HR_Fech" between ''2018-04-24 00:00:00'' and ''2018-04-25 23:59:59'' and ( upper("TipoAtiv") ilike upper(''Building Adequation%'')
or upper("TipoAtiv") ilike upper(''Interconnection%'') or ("TipoAtiv" ilike ''Instal%''and "TipoAtiv" not ilike ''%VoIP'') order by 1, "DT_HR_Fech", "Endereco"

syntax error: ''substring'' (substring)is not valid input at this position

Obrigado,

Alexandre
Alexandre Espindola

Alexandre Espindola

Curtidas 0
POSTAR