|
|
Archives of the TeradataForum
Message Posted: Thu, 18 Jan 2001 @ 17:53:00 GMT
Subj: | | Re: Unique Value Algorithm |
|
From: | | Frank Martinez |
How about we use the machine, guys?
/*****
* A more generic, Teradata-type solution!
*****/
SELECT COUNT(*)
FROM DrugPriceGroup;
SELECT COUNT(DISTINCT HASHROW(DrugCode, BeginDate, EndDate, EAC, DATE))
FROM DrugPriceGroup;
The only problem with this is that we generate a BYTE variable, which can't be CAST into an Integer. But if the solution that
Sudarsan suggests works, then this would work as well. Notice that I left off the time, because SQL is a "set" language, so the time isn't
set for each individual record, but as a set that is "joined" to the other data set from the table. In other words, the time won't be
different for any of the resulting values.
Or maybe I'm overdoing it?
iv
Frank C. Martinez IV
| |