2008年11月16日星期日

假设有table fooid status name1 active a2 active b3 inactive c4 inactive d
查询状态为inactive的记录中,id为最小的记录的name

SQL> select min(name) keep (dense_rank first order by id) name from test 2 where status='inactive';

没有评论: