ora_rowscn and joins not working together

2019-03-06 15:15发布

问题:

SELECT "Rental".*, "Rental".ora_rowscn as TimeStamp FROM "Rental" 
       inner join "UserBranch" on "UserBranch"."fkBranchId" = "Rental"."fkBranchId"
       WHERE "Rental"."IsDeleted"='N' ;

This query returns me invalid identifier exception in oracle 10g. I'm a beginner and don't know why the exception is coming. please help. Thank you.

回答1:

Select "Rental".* ,"UserBranch"."fkBranchId", "Rental".ora_rowscn as TimeStamp from "Rental","UserBranch"
        where "UserBranch"."fkBranchId" = "Rental"."fkBranchId"
     and "Rental"."IsDeleted"='N';

without joins it works perfectly for me



回答2:

Please try to get your values with the below query :

SELECT Rental.*, Rental.ora_rowscn as TimeStamp FROM Rental 
inner join UserBranch on UserBranch.fkBranchId = Rental.fkBranchId 
WHERE Rental.IsDeleted='N' ;