SET @idservizio:=CAST('**idservizio**' AS DECIMAL(10,0))
|||||
SELECT SET_VAL(SUBSTR(idfile,1,(LOCATE("*****",idfile)-1))) AS idfile
FROM s_servizi_allegati
where idservizio=@idservizio 
AND SET_VAL(SUBSTR(idfile,1,(LOCATE("*****",idfile)-1))) IS NOT NULL
ORDER BY id ASC