|
Archives of the TeradataForumMessage Posted: Wed, 10 Feb 2016 @ 09:36:02 GMT
You can try: sel grp, count(*) cnt, min(keyval),max(keyval) from ( sel keyval , quantile(3,keyval) grp from tst ) dq group by 1 order by 1 or - if you want to keep the ansi standard: sel grp, count(*) cnt, min(keyval),max(keyval) from ( sel keyval , (RANK() OVER (ORDER BY keyval) - 1) * 3 / COUNT(*) OVER() grp from tst ) dq group by 1 order by 1
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||