利用HAVING子句求中位数(收入的中位)select T1.income from graduates T1,graduates T2group by T1.incomehaving sum(case when T2.income >= T1.income then 1 else 0 end) >= count(*)/2and sum(case when T2.income <= T1.income then 1 else 0 end) >= count(*)/2 当数据条数是奇数时income17500.000当数据条数是偶数时income1500020000