[postgis-users] Using CASE
Bob Pawley
rjpawley at shaw.ca
Thu Feb 4 14:05:23 PST 2010
Hi
I've been attempting to use CASE to establish the spatial point in the following expression.
Update p_id.image
set the_geom =
(select st_translate(library.dgm_device.the_geom,
st_x (st_centroid(p_id.p_id.othe_geom)) -
st_x (st_centroid(library.dgm_device.ithe_geom)) ,
st_y (st_centroid(p_id.p_id.othe_geom)) - Select Case when p_id.devices.status = 'Pump #1'
and p_id.devices.devices_id = '3614'
then - 10000 -
st_y (st_centroid(library.dgm_device.the_geom)))
from p_id.p_id, library.dgm_device, p_id.processes, processes_count, p_id.devices
where library.dgm_device.description = 'In Line Pump'
and library.dgm_device.orientation = ta_orientation
and p_id.p_id.p_id_id = processes_count.p_id_id
and p_id.p_id.process_id = p_id.processes.process_id
and p_id.devices.devices_id = '3614'
and p_id.processes.fluid_id = p_id.devices.fluid_id)
from p_id.devices
where p_id.image.fluid_id = p_id.devices.fluid_id
and p_id.devices.devices_id = '3614'
and p_id.image.text_ = 'Pump #1'
and p_id.image.device_id = '3614';
I get - "ERROR: syntax error at or near "Select"
LINE 14: st_y (st_centroid(p_id.p_id.othe_geom)"
Any help would be appreciated.
Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100204/588c8196/attachment.html>
More information about the postgis-users
mailing list