Skip to content
Advertisement

Tag: group-by

SQL turning rows into columns and populating with values

I’m not quite sure why this table was designed this way, but it’s making it hard to solve my problem. Looking at the data: What I need help with is to do the following: For each name have the type_name as a column and then fill those columns with the default_value or value. Like this: Basically populates from default_value or

Group by not getting the expected results in mysql

I have the next query: That is working perfectly and returning 9 rows: I want to group the results by boat type and get the number of boats per type. However, when I do: I´m getting: but according to the first query, I´m expecting What am I missing? Answer I suspect that you want: That is: move the DISTINCT within

Mysql Group By age by range [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question i need help, i need to create report like this the report is group by the age, but i can’t get when age under <=

Selecting new distinct values over time (ORACLE SQL)

I want to select new distinct values and track them over time. I have a table where each row represents a score awarded to a particular person. – timestamp (when the score was awarded) – name (which person received the score) – score (what score the person received) I want the result to look like: The above table should be

Advertisement