简体   繁体   中英

How to update table with data from same table?

There is table in SQL-Server:

Track(
 id uniqueindeficater,
 Track geography,
 the_geom geometry
)

Now i want take Track column and put this data into the_geom column converting it from geography to geometry data type. SOmething like this:

GEOMETRY::STGeomFromText(Track.Track.STAsText(),4326)

How can i update column using data from same table?

Something like this:

update
  Track
set
  the_geom = GEOMETRY::STGeomFromText(Track.STAsText(),4326)

Doesn't this work?

update track
    set the_geom = GEOMETRY::STGeomFromText(Track.Track.STAsText(),4326)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM