小弟遇到一个怪问题。写了一段SQL语句如下:
from t_group_be_serviceno t,
t_group_unit u,
t_group_user e,
t_group_salay s,
t_group_countitem aa,
t_group_policy p
where u.org_id = e.unit_id
and e.login_no = t.be_manager
and t.unit_id = s.unit_id
and s.be_item= aa.id
and p.id = s.t_g_id and s.redate ='2009-03'
and t.remonth ='2009-03' group by u.org_id,aa.id,p.id
但是这段语句在plsql中执行的结果既然和在JAVA程序中的执行结果不一样
难道会是group by后的列的顺序造成
求高手指教在线等
from t_group_be_serviceno t,
t_group_unit u,
t_group_user e,
t_group_salay s,
t_group_countitem aa,
t_group_policy p
where u.org_id = e.unit_id
and e.login_no = t.be_manager
and t.unit_id = s.unit_id
and s.be_item= aa.id
and p.id = s.t_g_id and s.redate ='2009-03'
and t.remonth ='2009-03' group by u.org_id,aa.id,p.id
但是这段语句在plsql中执行的结果既然和在JAVA程序中的执行结果不一样
难道会是group by后的列的顺序造成
求高手指教在线等
执行结果不一样,是怎么不一样,是列不一样,还是结果集的顺序不一样你把hibernate转换以后的sql截出来。然后用客户端执行一下,看结果是否一样,hibernate也有cache处理还有,程序和客户端的事物也是隔离的,都有可能导致数据不一致。