Re: Distinct select over 2 fields?

2006-09-13 Thread Stuart Brooks
Why don't you just use a GROUP BY on lat,long? You could try using CONCAT: select distinct(CONCAT(lat, long)) from table where ... Steve Musumeche CIO, Internet Retail Connection [EMAIL PROTECTED] Brian Dunning wrote: Lat lon are two different fields. Either can be duplicated, but

Re: Distinct select over 2 fields?

2006-09-13 Thread Brian Dunning
But if I do this, how do I still get lat and lon as two different fields? This finds the right record set, but it returns both fields concatenated into a single field. On Sep 12, 2006, at 12:46 PM, Steve Musumeche wrote: You could try using CONCAT: select distinct(CONCAT(lat, long))

Re: Distinct select over 2 fields?

2006-09-13 Thread Brian Dunning
Never mind, I figured it out: select distinct(concat(lat,lon)), lat, lon where On Sep 13, 2006, at 6:57 AM, Brian Dunning wrote: But if I do this, how do I still get lat and lon as two different fields? This finds the right record set, but it returns both fields concatenated into a

Distinct select over 2 fields?

2006-09-12 Thread Brian Dunning
I'm searching a database of geopoints, and when two records have the same latitude and longitude, I only want to return one of them - basically just find all the unique locations. How do you set up a select like this? Thanks... -- MySQL General Mailing List For list archives:

Re: Distinct select over 2 fields?

2006-09-12 Thread Hiep Nguyen
select * from table where . limit 1 that would do it if you don't care which one it returns JC On Tue, 12 Sep 2006, Brian Dunning wrote: I'm searching a database of geopoints, and when two records have the same latitude and longitude, I only want to return one of them - basically

Re: Distinct select over 2 fields?

2006-09-12 Thread Brian Dunning
Many different records will be returned though, I just don't want any dupes where both lat/lon is the same. :) On Sep 12, 2006, at 12:20 PM, Hiep Nguyen wrote: select * from table where . limit 1 that would do it if you don't care which one it returns JC On Tue, 12 Sep 2006, Brian

Re: Distinct select over 2 fields?

2006-09-12 Thread Steve Musumeche
Select DISTINCT(lat_long_field) from table where... Steve Musumeche CIO, Internet Retail Connection [EMAIL PROTECTED] Brian Dunning wrote: Many different records will be returned though, I just don't want any dupes where both lat/lon is the same. :) On Sep 12, 2006, at 12:20 PM, Hiep

Re: Distinct select over 2 fields?

2006-09-12 Thread Brian Dunning
Lat lon are two different fields. Either can be duplicated, but not both. On Sep 12, 2006, at 12:33 PM, Steve Musumeche wrote: Select DISTINCT(lat_long_field) from table where... Steve Musumeche CIO, Internet Retail Connection [EMAIL PROTECTED] Brian Dunning wrote: Many different

Re: Distinct select over 2 fields?

2006-09-12 Thread Steve Musumeche
You could try using CONCAT: select distinct(CONCAT(lat, long)) from table where ... Steve Musumeche CIO, Internet Retail Connection [EMAIL PROTECTED] Brian Dunning wrote: Lat lon are two different fields. Either can be duplicated, but not both. On Sep 12, 2006, at 12:33 PM, Steve