fixed sql server and oracle reverse joins