【发布时间】:2018-06-19 23:23:30
【问题描述】:
我有一个TEMP_TABLE 有以下数据
SOURCE - Number
DESTINATION- Number
COUNT- Number (Total count of transactions)
SUM- Number (Total sum of transactions)
样本数据:
SOURCE DESTINATION COUNT SUM
123123123 99009900 65 1000000
123123123 88880303 12 90000
191113111 98980101 277 5000000
191113111 77778585 5 20000
191113111 56789547 740 75000000
我正在尝试根据COUNT 的值在source number with the destination number 上获得Top 150 results。如果 123123123 在表中有 200 行具有多个目标,我会尝试获取 123123123 的前 150 个结果并排除其他 50 行。
【问题讨论】:
标签: sql oracle select oracle11g greatest-n-per-group