SQL – grouping instances together
In SQL I am trying to group these values into single events, so that table 1 results in table 2.
How to roll up child products/(meaning rows) to main product/(meaning just one row)
I am trying to accomplish something that perhaps is simple but I can’t see it. I have several rows of a “child product” that need to roll up into a “main product”, just one row. I dont know to group the child rows into the main one and get the correct name.
sorting the groups made by group by clause using order by clause
Customers
customer_id first_name last_name age country
1 John Doe 31 USA
3 David Robinson 22 UK
4 John Reinhardt 25 UK
5 Betty Doe 28 UAE
6 Robert doe 16 USA
7 Robert gdo 32 USA