any help appreciated,a week now and I am stuck -
many thanks if you can.
I added an image of the problem but it's disappeared
WITH SITESmin as (
SELECT public.acc.Location_Easting_OSGR, public.acc.Location_Northing_OSGR
FROM acc Sites ,
ORDER BY ( acc.Location_Easting_OSGR - Sites.SITE_ETG ) * ( acc.Location_Easting_OSGR - Sites.SITE_ETG ) + (acc.Location_Northing_OSGR - "public"."Sites"."SITE_ETG" ) * ( acc.Location_Northing_OSGR - "public"."Sites"."SITE_NTG" )
LIMIT 1
)
UPDATE ACC
SET acc.Location_Easting_OSGR = SITESmin.acc.Location_Easting_OSGR,
acc.Location_Northing_OSGR = SITESmin.acc.Location_Northing_OSGR
FROM SITESmin;
Here's the error:
Error : ERROR: syntax error at or near "ORDER"
LINE 4: ORDER BY ( acc.Location_Easting_OSGR - Sites.SITE_ETG )...
The ^ carat appears just after the Line 4: colon
,at the end ofFROM acc Sites ,