I have few queries (I am very new to Teradata and I have previous experience of working in Oracle) :
1. I try to execute a simple block from Teradata SQL assistent :
declare
v_num integer;
begin
select 4/2 into v_num from CDP_DRV_0.dim_carr;
print ('v_num::::'||v_num);
end;
/
but it is throwing error. Can you please let me know how to resolve it.
2. Is the dual table exist in teradata?
3. Are the following statements valid :
a) A database can be created within a database.
b) A user can be created within a database.
c) A database can be created within a user.
d) A user can be created within a user.
4. select * from CDP_DRV_0.dim_carr where rownum < 2;
rownum is not a valid keyword in teradat for restricting rows. So what is the substitute of it.
5. Is analytical function there in teredata? If it is there can you please give an equivalent example.
/* The following query is valid in Oracle and it finds the employee name having 3rd max salary */
select empname,sal from
(select empname,sal,rownumber() over (partition by sal order by sal) rn from emp)
where rn=3;