expected something between the word 'xx' and ','.Unable to get..

Database
Enthusiast

expected something between the word 'xx' and ','.Unable to get..

select a12.xx  xx,
 a12.bb  bb
from (select a11.zz zz,
 CASE WHEN substring(a11.zz ,2,1)  between '0' and '9' THEN substring(a11.zz,1,1)  ELSE substring(a11.zz,1,2) END zz
from table1  a11) a12
group by a12.xx,
 a12.bb

Hi

I am new to terradata and get the following error when running the above sql.

'expected something between the word  ... and ,  unable to get catalogue string

any input will be greatly appreciated.

many thanks

2 REPLIES
Teradata Employee

Re: expected something between the word 'xx' and ','.Unable to get..

You select xx and bb from a12 but there's no column named this way on your a12 subquery.

btw your two columns are named zz on a12 subquery, shouldn't work too.

Enthusiast

Re: expected something between the word 'xx' and ','.Unable to get..

Hi, I think you are trying something like this..?

select a12.xx  xx,
a12.bb bb
from (select a11.zz xx,
CASE WHEN substr(a11.zz, 2, 1) between '0' and '9' THEN substr(a11.zz, 1, 1) ELSE substr(a11.zz, 1, 2) END bb
from table1 a11) a12
group by a12.xx,
a12.bb

Regards