I am a beginner for Teradata. I am trying to convert following SAS code in sql.
DO i=1 to 20 BY 1
IF (x>i/y) THEN DO
It seems there are no loops available in sql. Any help would be appreciated.
You need to create a Stored Procedure to be able to use loops, of course most DBA's don't like end users to create SPs.
What are you trying to achieve? Maybe it's possible in plan SQL.
I was using this snippet of code for the purpose of bucketing. There are 20 different buckets and I have to perform 20 different actions for them based on some conditions.