I have a mysql table, which is as follows:
image_id imagename brandname x y
143 00003.jpg Pirelli 147 265
125 00003.jpg Pirelli 500 259
Through mouse clicks I am generating x and y positions on a html canvas which I want to use to subset the table. For example, if the clicked position of x and y were 510 and 262, I want to retrieve the image id 125 as both the parameters are matching.
Suppose if the x value generated with mouse click is 510, i want to select the line with image_id 125.
I tried the following:
select * from table where imagename='00003.jpg' and 510 < max(x);
I am getting this error:
invalid use of group function.