![]() |
|
Archives of the TeradataForumMessage Posted: Fri, 22 Jan 2010 @ 15:06:09 GMT
Hi All I having difficulty replacing some Oracle syntax from our old system with Teradata syntax. The requirement of the syntax is to find the 1st position of a space in a text string and the 2nd and 3rd etc. The syntax we did use was:
UPDATE database.table
SET column_1 = INSTR(column_x,' ',1,1);
UPDATE database.table
SET column_2 = INSTR(column_x,' ',1,2);
UPDATE database.table
SET column_3 = INSTR(column_x,' ',1,3);
Etc
I have been able to work out a way of working out the position of the first space:
SELECT INDEX (column_x, ' ' )
FROM database.table;
but can't figure out how to do this for 2nd, 3rd etc spaces. Any help will be gratefully received. Thanks Paul Graham
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||