日期:2014-05-17  浏览次数:20510 次

视图看不懂求解释
(select (select code_name from t_sys_code where type_id='0818' and code_value=worker_type and rownum=1) from t_pas_worker where worker_code=recdet.driver_code and rownum=1) worker_type

这段sql文  是一个select 的其中一个字段  求高手帮忙解释一下 这段打码里  worker_type 的角色是怎么回事
sql?视图?

------解决方案--------------------
这是2000里面常用的生成序列的方法,在2005中用row_number直接就可以生成,用的思路其实就是你这里的
select *,(select count(1) from tb b where b.id<=a.id)
 from tb a