1
我有以下查詢:SQL搜索錯誤:每個派生的表必須有它自己的別名
String queryString = "SELECT pk"
+ " FROM ({{SELECT COUNT(*) as num, {Book.pk} as pk"
+ " FROM {Rental JOIN Book ON {Rental.product} = {Book.pk}}"
+ " GROUP BY {Rental.product}, {Book.pk}"
+ " ORDER BY num DESC LIMIT ?limit}})";
當我執行此,我得到的錯誤「每個派生的表必須有它自己的別名」。我錯過了什麼?
謝謝你的快速回復,我會嘗試,現在! – Kapparino