Hi all,
I'm trying to get deciles for a large file about 20-30 million recs. I'm running out of spool space on the sort part. Is there any way i could improve my sorts?
This is what i do. first, i get sums of sales per client. then, i assign deciles to the sales. finaly, i compute max, min, avg...
can i do something like this somehow?
declare x float;
set x = select count(*) from t1;
i want to use x as a row count in several places in following queries in my procedure.
thx all for your previous responses!!!
how can i define and use variables?
I have a query with a bunch of hardcoded dates. i'd like to replace them with a variable, which i can define before the query. I'm running a simple query batch.
%var1% = '2001-01-01'
select * from t1 where dt = %var1%
something like this.
is there a ref for teradata anywhere? Please dont just say info.ncr.com or teradata.com because i cant find anything there and some resources are pswd protected.
my immediate questions is how to subtract two dates. i need to get the number of days between max(dt) and min(dt).
this what i use...
I was writing some queries on my local sql srv and am trying to translate them into tera now. the problem is with select statements inside the main query such as this -
SELECT x.cust_id,
(SELECT SUM(tot_sal_amt)
FROM table1 a
WHERE date < '1/1/2001' AND a.cust_id = x.cust_id)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.