> -Original Message-
> From: Albert E. Whale [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 02, 2008 4:06 PM
> To: mysql@lists.mysql.com
> Subject: Update with select
>
> I am trying to update a field on a record in a table. Here is the
> statement I create
@lists.mysql.com
Subject: Update with select
I am trying to update a field on a record in a table. Here is the
statement I created:
UPDATE pdata SET pvalue = ( SELECT pvalue
FROM pdata
WHERE pentrytime =1207022400 )
WHERE pentrytime =117540;
However, I get the following error:
|#1093 - You can
I am trying to update a field on a record in a table. Here is the
statement I created:
UPDATE pdata SET pvalue = ( SELECT pvalue
FROM pdata
WHERE pentrytime =1207022400 )
WHERE pentrytime =117540;
However, I get the following error:
|#1093 - You can't specify target table 'pdata' for upda
From: "Pete Lancashire"
> update fooloc set location = geomfromtext('point(lat lon)');
I have no experience with spatial tables, but from the manual I conclude
that either of these should do the job:
UPDATE `fooloc` SET `location` = GeoFromWKB(point(`lat`, `lon`));
or
UPDATE `fooloc`
I have an existing MyISAM table that I want to add a spatial column
to. It originally had two integer columns, lat and lon, and I've
added a new column "location point NOT NULL default ''"
Example data:
select lat, lon, astext(location) from fooloc;
+--+--+--+
| lat