Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Substring Error? - response (1) by M.Saeed Khurram

$
0
0

Hi,
There are two syntax available for substring:
SUBSTRING( STRING FROM FOR)
SUBSTR(STRING , START_INDEX , LENGTH)
So if you are using substring you must specify FROM and FOR instead of comma. Other wise you can use SUBSTR with COMMAs.
Try this

SUBSTR(CASE WHEN TABLE_A.COL_1 IS NOT NULL THEN TABLE_A.COL_1 ELSE TABLE_B.COL_1 END, LENGTH(CASE WHEN TABLE_A.COL_1 IS NOT NULL THEN TABLE_A.COL_1 ELSE TABLE_B.COL_1 END)-11,12) IN (SELECT COL_1 FROM TABLE_C)

 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>