代码语句如下:
Select Count(*) From "plus_progress" P
LEFT JOIN "plus_progress_version" V ON P."ProgressId"=V."ProgressId" -- LEFT JOIN PT_yhmc AS yhmc ON V.InputUser=yhmc.v_yhdm
Inner Join "plus_progress_privilege" Pr On
P."ProgressId" = Pr."ProgressId"
Where P."FlowState"=1 AND "PrjId"=:prjId AND PR."UserCode"=:userCode And V."ProgressVersionId" In(
Select "ProgressVersionId" From
(
Select Rownum AS R,AA.* From
(Select
"ProgressVersionId"
From "plus_progress_version" V
WHERE V."ProgressId" = P."ProgressId" ORDER BY V."InputDate" DESC) AA ) BB where BB.r<=1 )
加了引号的是因为在数据库中表名和列名都有小写的,此语句实在不知道错在哪里,求大神指点
------最佳解决方案--------------------
子查询不能包含order by 语句、
------其他解决方案--------------------
表名和列名都有小写,和加引号有何关系?去掉引号看看。