PostgreSQL
 sql >> Datenbank >  >> RDS >> PostgreSQL

Mehrere Fälle mit Ausgabe in derselben Zeile

select
    min(purchaseDate) filter (where fruitType = 'apple') as apple,
    min(purchaseDate) filter (where fruitType = 'orange') as orange,
    customer
from fruitPurchases
group by customer