0
Order OrderItem Product
-----------------------------------------------------------------------------
id id,orderId,proudctId,unitPrice,quantity id, barcode
JPA的EclipseLink:列表順序項,以便通過訂單ID,產品條形碼,及數量:JPA的EclipseLink Oracle數據庫錯誤:不是選擇的表達
select * from OrderItem order by orderId asc,
lpad(product.barcode, 20, '0') desc, quantity asc
Query: ReadAllQuery(referenceClass=OrderItem sql="SELECT * FROM (SELECT a.*,
ROWNUM rnum FROM (SELECT DISTINCT t1.ID AS a1, t1.QUANTITY AS a2,
t1.UNITPRICE AS a3, t1.orderId AS a4, t1.productId AS a5, lpad(t0.barcode, ?, ?)
FROM Product t0, OrderItem t1 WHERE (t0.ID = t1.productId) ORDER BY t1.orderId
ASC, lpad(t0.barcode, ?, ?) DESC, t1.QUANTITY ASC) a WHERE ROWNUM <= ?) WHERE
rnum > ?")
ERROR ORA-01791:不是選擇的表達
如果在oracle sqlPlus中執行SQL,沒有錯誤。如果只是通過product.barcode而不是lpad(...)來命令,它就可以工作。