substring_index(str, delim, count)Originariamente inviato da centro
se length e la lunghezza nel tuo modo non toglie solo primo "<" che incontra o sbaglio..?
Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned. SUBSTRING_INDEX() performs a case-sensitive match when searching for delim.
basta fare una copia della tabella e provare....Originariamente inviato da centro
Io lo interpretata così... (sempre se non ho capito male di come si usa sta funzione substring())
update tabella
set
campo1 = substring(campo1, '<',LEN(campo1)),
campo2 = substring(campo2, '<',LEN(campo2)),
campo3 = substring(campo3, '<',LEN(campo1))
campo4 ..... etc.
che dici... cosi sberello il db è basta?
una buona giornata!!!!!
e grazie![]()
prova anche con charindex() o patindex() che restituiscono la posizione della prima occorrenza nella stringa. Come ti e' stato detto in precedenza.