Skip to content

How to average/aggregate the result off a SQL query?

I have a table with many rows each belonging to different users. I first want to select all rows the belong to one user and then on each row add the average for that a certain column but can’t make it work. I’m would like the result to display the average on each row for the user but it’s cu…

MySql : how to join this two tables with multiple pivot

I want to get the last activity of my client but i dont know how to that that with two tables that have more than one pivot. Please look at to the example below : I want this result (last activity is the lastest date of (check_mo and check_pa). and relationship between tables is (account.id => product.chec…