Archives of the TeradataForum
Message Posted: Tue, 28 Oct 2008 @ 14:17:11 GMT
Subj: | | SAMPLE Command to obtain 5 per location |
|
From: | | Phil.Oldfield |
I have a table that has a location reference and customer account no's
I need SQL/Macro/Procedure that can sample 5 customer account no's per location without needing to use
SAMPLE
WHEN location = 1 then 5
WHEN location = 2 then 5
etc.
I was thinking of a procedure to insert each sample of 5 into a table using a cursor but you can only insert single rows in a
procedure
Any help appreciated
Phil Oldfield
Iceland Foods
|