l***y 发帖数: 184 | 1 9. Given the SAS data set WORK.TRANSACT:
Rep Cost Ship
----- ----- -----
SMITH 200 50
SMITH 400 20
JONES 100 10
SMITH 600 100
JONES 100 5
The following output is desired:
Rep
----- ----
JONES 105
SMITH 250
Which SQL statement was used?
A. select
rep,
min(Cost+Ship)
from WORK.TRANSACT
order by Rep
;
B. select
Rep,
min(Cost,Ship) as Min
from WORK.TRANSACT
summary by Rep
order by Rep
;
C. select
Rep,
min(Cost,Ship)
from WORK.TRANSACT
group by Rep
order by Rep
;
(改成min(sum(cost,ship))才对)
D. select
Rep,
min(Cost+Ship)
from WORK.TRANSACT
group by Rep
order by Rep
答案是D, 可是没有对Rep 进行分组啊?是怎么回事呢? |
|