Skip to content
Advertisement

Tag: min

Easy substraction of year’s values

I do have the following database table containing the timestamps in unix format as well as the total yield (summing up) of my solar panels every 5 mins: Now I would like to calculate how much energy was produced each year. I thought of reading the first and last timestamp using UNION of each year: This works fine but I

Using a MIN MAX query over a DISTINCT one in MySQL?

With my new job, I am needing to use SQL more and more. As I need to remove duplicate columns I thought that using a DISTINCT statement would be best. However, I was indicated that a MIN MAX statement might be more suited. As I am still fairly new to SQL I was wondering if I could get some advice

Advertisement