with sample_data as (select '26.03.2015 14:10' as adate, 4 as type, 40 as object, 111 as barcode from dual union all
select '26.03.2015 14:09' as adate, 1 as type, 55 as object, 222 as barcode from dual union all
select '26.03.2015 14:08' as adate, 2 as type, 33 as object, 777 as barcode from dual union all
select '26.03.2015 14:08' as adate, 2 as type, 34 as object, null as barcode from dual union all
select '26.03.2015 13:20' as adate, 3 as type, 41 as object, null as barcode from dual union all
select '26.03.2015 12:00' as adate, 1 as type, 56 as object, 444 as barcode from dual union all
select '26.03.2015 11:59' as adate, 2 as type, 37 as object, 555 as barcode from dual union all
select '26.03.2015 11:59' as adate, 2 as type, 48 as object, null as barcode from dual)
select
adate, type, object, barcode
from sample_data
where type in (1, 2);
1型完成建设,2型是组件的一部分获取对象的子对象的层次
我需要下一个结果
55 | 222 | 26.03.2015 14:08 | 33
55 | 222 | 26.03.2015 14:08 | 34
56 | 444 | 26.03.2015 11:59 | 37
56 | 444 | 26.03.2015 11:59 | 38
所以我们看到的反对包含子对象,和两个日期= 26.03.2015 14:08 和对象包含子对象,和两个日期= 2015年3月26日11时59分
在开始我知道两个参数 - 日期和成品建筑物的条形码,例如在我的数据 - 日期2015年3月26日14:09和条形码或日期2015年3月26日12:00和条形码
是什么对象和子对象之间的连接?是否由于按日期排序? – 2015-03-31 10:51:33
当前对象类型为1之前的所有以前的类型为2的子对象 – 2015-03-31 11:14:59