I am trying to find the minimum difference between years for each ID. For example, I have this data: and I want this output: Answer You could use a LEFT JOIN Online Demo
Tag: minimum
Get minimum unused value in MySQL column
I have a table with integer ID column. I would like to get the minimum unused value for this column. The query should find the first hole in table IDs and get the minimum value inside it. I’ll try to explain it with some examples. Example 1: no-holes table In this case, I have a table without holes and query