cancel
Showing results for 
Search instead for 
Did you mean: 

SQLSCRIPT: sql syntax error: incorrect syntax near "AS"

nathan23
Explorer
0 Kudos
3,519
Hi 
CASE WHEN (inTab."/BIC/C55CONTID" is NOT null) 
               THEN      
               CASE WHEN (inTab."/BIC/CRCBECFVN" >1 ) THEN
                    (SELECT "/BIC/K5SCDCEC" FROM "/BIC/AZD_TVOG2"  WHERE "/BIC/AZD_TVOG2"."/BIC/CRCBECFVN" = 1) AS "/BIC/K5SCDCEC",
                 ELSE 
                   "/BIC/K5SCDCEC" AS "/BIC/K5SCDCEC"
                   END
				   END

after writing this logic gives me an error on the AS, can you tell me the reason?

View Entire Topic
mgregur
Active Contributor
0 Kudos

Hi,

like everyone else said, you have "AS" in the wrong place, but also I see two CASE WHEN but only one ELSE statements, you might want to check that part.

BR,

Matija