I have a table called eatable. It has columns such as type, name.
type column has fruit, veggie, veggie, fruit, veggie
values
.
name column has apple, brinjal, carrot, banana, cabbage
.values
I want the output as, type column must display only 2 rows and name should display all the values.
It should like below:
I have tried the below query, but it isn't I am expected:
select distinct on (type) type, name from eatable;
Help me out!!