ok call me stupid
but here is another one
lets say instead of getting the max we want to merge them
input
62997 'blue'
100004 'red'
62997 'green'
100008 'red'
100004 'black'
output
62997 'blue, green'
100004 'red, black'
100008 'red'
Lets say we have a table with an id and a date
I want to find the most recent date for each id.
eg
62997 2000-12-16
63702 2000-02-02
100004 2001-03-14
62997 2000-02-22
100008 2000-03-26
should output
62997 2000-12-16
63702 2000-02-02
100004 2001-03-14
100008 2000-03-26
This is easy...
I am having some trouble with an SQL query
the data would look something like thie
id attribute
1 blue
2 yellow
1 black
3 white
4 green
2 blue
5 green
2 brown
1 yellow
4 white
the output needs to be like this.
id attribute
1 blue,black,yellow
2 yellow, blue, brown
3 white
4 green
5 green,white...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.