I am new to SQL and have been trawling around for an answer on this for the past few days but can't seem to find a definitive answer. (Or I am not understanding the solutions given as they don't match my scenario)
I have a table that resembles the below:
unique reference|tel number| tel priority
123|0123456910|2
123|0654321910|6
214|0056897910|4
I want to only output data where the priority of the tel number is the lowest for each unique reference, so in the above example I would want:
unique reference|tel number| tel priority
123|0123456910|2
214|0056897910|4
Any pointers/guidance is much appreciated, I have tried the MIN() functions but was unable to get it to do this as an output so I think I am missing something.
(I have SQL server 2008 r2 or Microsoft report builder)