Re: [Hampshire] SQL SELECT query.

2009-12-06 Thread Philip Stubbs
2009/12/6 Hugo Mills : >   SQL is really, really bad at this kind of job, I'm afraid. If you > want precisely the longest way, it's going to have to look something > like this, I think: > > SELECT way,highway,aeroway,name,ref,char_length(ref) AS length, >  ST_Length(way) AS road_len, >  CASE WHEN b

Re: [Hampshire] SQL SELECT query.

2009-12-06 Thread Hugo Mills
On Sun, Dec 06, 2009 at 09:53:56PM +, Philip Stubbs wrote: > 2009/12/6 Hugo Mills : > > On Sun, Dec 06, 2009 at 07:32:25PM +, Philip Stubbs wrote: > >> Hi, > >> > >> I have been playing with mapnik to create some maps. It has been fun, > >> but I am a bit lacking in Postgres SQL. Can anybod

Re: [Hampshire] SQL SELECT query.

2009-12-06 Thread Philip Stubbs
2009/12/6 Hugo Mills : > On Sun, Dec 06, 2009 at 07:32:25PM +, Philip Stubbs wrote: >> Hi, >> >> I have been playing with mapnik to create some maps. It has been fun, >> but I am a bit lacking in Postgres SQL. Can anybody help me to adjust >> the following SELECT statement so that it will retur

Re: [Hampshire] SQL SELECT query.

2009-12-06 Thread John Cooper
On 06/12/09 19:32, Philip Stubbs wrote: > Hi, > > I have been playing with mapnik to create some maps. It has been fun, > but I am a bit lacking in Postgres SQL. Can anybody help me to adjust > the following SELECT statement so that it will return a result set > that consists of only one of each d

Re: [Hampshire] SQL SELECT query.

2009-12-06 Thread Hugo Mills
On Sun, Dec 06, 2009 at 07:32:25PM +, Philip Stubbs wrote: > Hi, > > I have been playing with mapnik to create some maps. It has been fun, > but I am a bit lacking in Postgres SQL. Can anybody help me to adjust > the following SELECT statement so that it will return a result set > that consist

[Hampshire] SQL SELECT query.

2009-12-06 Thread Philip Stubbs
Hi, I have been playing with mapnik to create some maps. It has been fun, but I am a bit lacking in Postgres SQL. Can anybody help me to adjust the following SELECT statement so that it will return a result set that consists of only one of each distinct 'name'? SELECT way,highway,aeroway,name,re