0

Is there a way that I can retrieve data in a query where 1 value appears more than another in a set time.

My current query is:

SELECT * FROM location.track where time > date_sub(now(), interval 15 second)

which will pull the data i need for the past 15 seconds data value e.g.~

1, red
1, red
1, red
1,blue
1,yellow
2,red
2,green
3,orange

if red shows more than any other value in column 2 where column 1 value stays then same then only retrieve 1,red in the query?

The reason for wanting this query is I am using the data as a variable to colour a 1-100 html grid where if column 1 value matches the html table cell value then change colour of that cell to the colour linked with the mysql value.

streetturtle
  • 5,472
  • 2
  • 25
  • 43

0 Answers0