我使用PostgreSQL 8.3和我有一個簡單的SQL查詢: SELECT a.id,a.bpm_process_instance_id,a.actor_id
FROM bpm_task_instance a
WHERE a.bpm_process_instance_id IN
(
SELECT bpm_process_instance_id
FROM inci
我想運行此查詢: SELECT DISTINCT ON (address_id) purchases.address_id, purchases.*
FROM purchases
WHERE purchases.product_id = 1
ORDER BY purchases.purchased_at DESC
但我得到這個錯誤: PG::Error: ERROR: SELECT DI