PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Diversi casi quando sono con output sulla stessa riga

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