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