I run the following query against Teradata using SAS, and it works fine
SELECT LEFT(first_name,7)
FROM testTab
However, when I run the same query in Sql Assistant it throws an error : Expected something between keyword SELECT and keyword LEFT.
On my other computer, the above code runs on Sql Assistant.
So, my question is, why does the LEFT function work sometimes, and sometimes it doesn't ?
There are a lot of workarounds, but I want to know what the hell is going on with this LEFT function ?
I'm not sure how the SAS version was running as LEFT is not a function in Teradata. LEFT is a keyword in Teradata because of LEFT OUTER JOIN. Perhaps SAS has some sort of parser/rewrite thing that changes it over to proper Teradata function.
At any rate, to do this in Teradata you can do:
SELECT SUBSTRING(first_name FROM 1 FOR 7) FROM testtab
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With