This is my table structure
id state city lat lon
1 erer wer 34 34
2 ffff dfd 44 33
1 fds rw 0 45
Using this, I have to retrieve the data without duplicates from the above table. If I have to retrieve data with id 1 and 2, I used Group by id. Now I also have to check one more condition, whether the lat > 0.
select *
from table
group by id and lat > 0
But still data with 0 is also being retrieved.
Try,