Robert (Jamie) Munro wrote: > But fileid = gpx_files.id = gpx_id. Yes, good point, I'd not edited my original SQL correctly (it also included gpx_files.user_id=users.id which is why gpx_files was in there). cheers Richard