sql1:
select *
from (select t_.*, rownum as n_from (select rid,"FId","FCreateTime",
"FStatus",
"FLeiBie",
"FName",
"FHangYe",
"FHangYe$",
"FRegionId",
"FRegionId$",
"FOfficePhone",
"FUserId",
"FUserId$",
"FDepartmentId",
"FDepartmentId$",
"FSumdingdane",
"FChanPingXian",
"FBaoBeiStatus",
"FYinruStatus",
"Fxiumian",
"Fkfry",
"Fkfry$",
"Fkhbm",
"Fkhbm$",
"Fshiti",
"Fshiti1",
"Fshiti2",
"Fshiti3"
from (select "TcCustomer".rowId as rid,"TcCustomer"."FRegionId",
"TcCustomer"."FLeiBie",
"TcCustomer"."Fshiti",
"TcCustomer"."FOfficePhone",
"TcCustomer"."FHangYe",
"TcCustomer"."Fkhbm",
"TcCustomer"."Fxiumian",
"TcCustomer"."FChanPingXian",
"TcCustomer"."FBaoBeiStatus",
"TcCustomer"."FYinruStatus",
"TcCustomer"."FDepartmentId",
"TcCustomer"."FSumdingdane",
"TcCustomer"."Fshiti3",
"TcCustomer"."FUserId",
"TcCustomer"."FCreateTime",
"TcCustomer"."FStatus",
"TcCustomer"."FName",
"TcCustomer"."FId",
"TcCustomer"."Fkfry",
"TcCustomer"."Fshiti1",
"TcCustomer"."Fshiti2",
"TsUser_1"."FName" as "FUserId$",
"TsDepartment_1"."FName" as "Fkhbm$",
"Tuindustry_1"."FName" as "FHangYe$",
"TsDepartment_2"."FName" as "FDepartmentId$",
"TsUser_2"."FName" as "Fkfry$",
"Tuarea_1"."FName" as "FRegionId$"
from "TcCustomer"
left join "TsUser" "TsUser_1"
on "TsUser_1"."FId" = "TcCustomer"."FUserId"
left join "TsDepartment" "TsDepartment_1"
on "TsDepartment_1"."FId" = "TcCustomer"."Fkhbm"
left join "Tuindustry" "Tuindustry_1"
on "Tuindustry_1"."FId" = "TcCustomer"."FHangYe"
left join "TsDepartment" "TsDepartment_2"
on "TsDepartment_2"."FId" =
"TcCustomer"."FDepartmentId"
left join "TsUser" "TsUser_2"
on "TsUser_2"."FId" = "TcCustomer"."Fkfry"
left join "Tuarea" "Tuarea_1"
on "Tuarea_1"."FId" = "TcCustomer"."FRegionId") "TcCustomer"
where "FLeiBie" = 'qudao'
order by "FCreateTime" asc) t_
where rownum <= 1000)
where n_<=375 and n_ > 350;
sql2:
select *
from (select t_.*, rownum as n_
from (select rid,"FId","FCreateTime",
"FStatus",
"FLeiBie",
"FName",
"FHangYe",
"FHangYe$",
"FRegionId",
"FRegionId$",
"FOfficePhone",
"FUserId",
"FUserId$",
"FDepartmentId",
"FDepartmentId$",
"FSumdingdane",
"FChanPingXian",
"FBaoBeiStatus",
"FYinruStatus",
"Fxiumian",
"Fkfry",
"Fkfry$",
"Fkhbm",
"Fkhbm$",
"Fshiti",
"Fshiti1",
"Fshiti2",
"Fshiti3"
from (select "TcCustomer".rowId as rid,"TcCustomer"."FRegionId",
"TcCustomer"."FLeiBie",
"TcCustomer"."Fshiti",
"TcCustomer"."FOfficePhone",
"TcCustomer"."FHangYe",
"TcCustomer"."Fkhbm",
"TcCustomer"."Fxiumian",
"TcCustomer"."FChanPingXian",
"TcCustomer"."FBaoBeiStatus",
"TcCustomer"."FYinruStatus",
"TcCustomer"."FDepartmentId",
"TcCustomer"."FSumdingdane",
"TcCustomer"."Fshiti3",
"TcCustomer"."FUserId",
"TcCustomer"."FCreateTime",
"TcCustomer"."FStatus",
"TcCustomer"."FName",
"TcCustomer"."FId",
"TcCustomer"."Fkfry",
"TcCustomer"."Fshiti1",
"TcCustomer"."Fshiti2",
"TsUser_1"."FName" as "FUserId$",
"TsDepartment_1"."FName" as "Fkhbm$",
"Tuindustry_1"."FName" as "FHangYe$",
"TsDepartment_2"."FName" as "FDepartmentId$",
"TsUser_2"."FName" as "Fkfry$",
"Tuarea_1"."FName" as "FRegionId$"
from "TcCustomer"
left join "TsUser" "TsUser_1"
on "TsUser_1"."FId" = "TcCustomer"."FUserId"
left join "TsDepartment" "TsDepartment_1"
on "TsDepartment_1"."FId" = "TcCustomer"."Fkhbm"
left join "Tuindustry" "Tuindustry_1"
on "Tuindustry_1"."FId" = "TcCustomer"."FHangYe"
left join "TsDepartment" "TsDepartment_2"
on "TsDepartment_2"."FId" =
"TcCustomer"."FDepartmentId"
left join "TsUser" "TsUser_2"
on "TsUser_2"."FId" = "TcCustomer"."Fkfry"
left join "Tuarea" "Tuarea_1"
on "Tuarea_1"."FId" = "TcCustomer"."FRegionId") "TcCustomer"
where "FLeiBie" = 'qudao'
order by "FCreateTime" asc) t_
where rownum <= 375)
where n_<=375 and n_ > 350;
两个sql的差别就是减少了中间结果集,rownum<=1000,rownum<=375的区别,结果整个处理的数据就不一样了,我把两种的全部导出来,发现到300多条就不一致了,真的很神奇;
解决办法:增大第二个sql的结果集 rownum <= 375+25