您好,欢迎访问一九零五行业门户网

Oracle排序取第一条数据

oracle需要更新套组的大单位, 规则是取第一个学员(套组id最小)的单位信息。
oracle需要更新套组的大单位, 规则是取第一个学员(套组id最小)的单位信息。
采用按照suiteid排序取第一条方法。
update sim_big_suite u set u.org_code = (
select substr(x.pilot_unit,1,4) from(
select n.* from sim_student_assign n where
 n.big_suite_no = 192 and
--u.big_suite_no = n.big_suite_no and 
n.ac_type_code = 14
and n.fixed_year = '2013上半年' and n.train_com = 1001 and n.position = 'l'
order by n.suite_id
)x where rownum = 1
)where u.ac_type_code = 14 and u.fixed_year = '2013上半年' and u.train_com = 1001;

其它类似信息

推荐信息