Sorry, I'm pretty much a SQL noob. This should work in MSFT SQL, Oracle, as well as Sybase. In the next snippet, I need to change the inner join between IJ and KL to IJ.PO_id = KL.PO_id to left join also to IJ.PO_id = KL.PO_id . So, I think I need to overestimate this. Well, implicit associations are not the most read, at least in the eyes of my colleagues. I guess I agree until I develop my own taste. Sorry, just in case, I distorted the names of tables and fields.
from AB, CD, EF, GH, IJ, KL where EF.EF_id = IJ.EF_id and IJ.EF_id = AB.EF_id and EF.ZY_id = IJ.ZY_id and IJ.ZY_id = AB.ZY_id and IJ.IJ_id = AB.IJ_id and IJ.IJ_id = @IJ_id and EF.XW_id = GH.GH_id and AB.VU_code = CD.VU_code and IJ.TS > 0 and IJ.RQ = 0 and EF.RQ = 0 and AB.RQ = 0 and IJ.PO_id = KL.PO_id;
Now my difficulty is that there is a lot going on in the where clause. Things that don't look like ab = cd remain in the where clause, but not everything that looks like ab = cd is easy to convert to an explicit join. The difficult part is that, ideally, the conditions would be between neighbors - AB+CD , CD+EF , EF+GH , GH+IJ , IJ+KL , but they are not organized now. I could reorder some, but in the end I do not want to forget about my goal: I want the new request to be no slower, and I want the new request to be no less readable. It seems to me that it might be better to hack only the part that I need to change, and leave it basically the same. I'm not sure if I can do this.
If you understand my intention, offer the best request. if you have not done so, then please tell me how I can improve the question. Thanks.
source share