I have a table with 2 column latitude and longitude.
some of data rows have exact match tandem values on 2 columns .
/* Points Table */
lat |long
2.1 |5.8
2.1 |5.6 -Set as Group
2.1 |5.6 -Set as Group
2.1 |5.6 -Set as Group
2.3 |5.2
2.4 |5.3
2.5 |5.3 -Set as Group
2.5 |5.3 -Set as Group
2.6 |5.3
2.5 |5.3
I want to set as Group tandem values of 2 columns , for example the result of my SQL Query Like :
/* Points Table */
lat |long
2.1 |5.8
2.1 |5.6 -Grouped
2.3 |5.2
2.4 |5.3
2.5 |5.3 -Grouped
2.6 |5.3
2.5 |5.3
How can i do this ?
Use
DISTINCTkeyword to remove duplicate record.Alternatively you can group them by
GROUP BYclause like this:See this SQLFiddle