sql >> Base de Datos >  >> RDS >> PostgreSQL

Varios casos cuando hay salida en la misma fila

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