我知道这个错误
DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=((select * from ( select rownumber() over(;BEGIN-OF-STATEMENT;<delete>, DRIVER=3.50.152
当我运行以下查询时:
((SELECT ORGANIZATION.ORGNAME AS ORGNAME
,SUBSCRIPTION.ID AS SUBSCRIPTIONID
,SUBSCRIPTION.NUMBEROFAVAILABLESEATS AS AVAILABLESEATS
FROM SUBSCRIPTION SUBSCRIPTION
,ORGANIZATION ORGANIZATION
,CUSTOMER CUSTOMER
,CUSTOMERACCOUNT CUSTOMERACCOUNT
WHERE ORGANIZATION.ISDELETED=0
AND SUBSCRIPTION.DELETED=0
AND CUSTOMERACCOUNT.ID=SUBSCRIPTION.CUSTOMERACCOUNTID
AND CUSTOMER.ISDELETED=0
AND CUSTOMERACCOUNT.CUSTOMERID=CUSTOMER.ID
AND CUSTOMER.PARTYID=ORGANIZATION.ID
AND ISLIMITEDSEAT=1
UNION ALL
SELECT ORGANIZATION.ORGNAME
,SUBSCRIPTION.ID AS SUBSCRIPTIONID
,-1 AS AVAILABLESEATS
FROM SUBSCRIPTION SUBSCRIPTION
,ORGANIZATION ORGANIZATION
,CUSTOMER CUSTOMER
,CUSTOMERACCOUNT CUSTOMERACCOUNT
WHERE ORGANIZATION.ISDELETED=0
AND SUBSCRIPTION.DELETED=0
AND CUSTOMERACCOUNT.ID=SUBSCRIPTION.CUSTOMERACCOUNTID
AND CUSTOMER.ISDELETED=0
AND CUSTOMERACCOUNT.CUSTOMERID=CUSTOMER.ID
AND CUSTOMER.PARTYID=ORGANIZATION.ID
AND ISLIMITEDSEAT=0
) as results
order by ORGNAME
) with ur
Hibrnate 解码查询:
"((select * from ( select rownumber() over(order by ORGNAME)with ur) as rownumber_, ORGANIZATION.ORGNAME AS ORGNAME,SUBSCRIPTION.ID AS SUBSCRIPTIONID,SUBSCRIPTION.NUMBEROFAVAILABLESEATS AS AVAILABLESEATS FROM SUBSCRIPTION SUBSCRIPTION,ORGANIZATION ORGANIZATION,CUSTOMER CUSTOMER,CUSTOMERACCOUNT CUSTOMERACCOUNT WHERE ORGANIZATION.ISDELETED=0 AND SUBSCRIPTION.DELETED=0 AND CUSTOMERACCOUNT.ID=SUBSCRIPTION.CUSTOMERACCOUNTID AND CUSTOMER.ISDELETED=0 AND CUSTOMERACCOUNT.CUSTOMERID=CUSTOMER.ID AND CUSTOMER.PARTYID=ORGANIZATION.ID AND ISLIMITEDSEAT=1 UNION ALL SELECT ORGANIZATION.ORGNAME,SUBSCRIPTION.ID AS SUBSCRIPTIONID,-1 AS AVAILABLESEATS FROM SUBSCRIPTION SUBSCRIPTION,ORGANIZATION ORGANIZATION,CUSTOMER CUSTOMER,CUSTOMERACCOUNT CUSTOMERACCOUNT WHERE ORGANIZATION.ISDELETED=0 AND SUBSCRIPTION.DELETED=0 AND CUSTOMERACCOUNT.ID=SUBSCRIPTION.CUSTOMERACCOUNTID AND CUSTOMER.ISDELETED=0 AND CUSTOMERACCOUNT.CUSTOMERID=CUSTOMER.ID AND CUSTOMER.PARTYID= ORGANIZATION.ID AND ISLIMITEDSEAT=0) results order by ORGNAME)with ur ) as temp_ where rownumber_ <= ?"