kevin
kevin

Reputation: 309

SQL syntax error: no such column

I am new to SQL. I am stuck on the error for a while, I hope some one could help me.

update roads1f set indoorpathway=PathWay1f.Indoor_pathway where astext(roads1f.geometry)= astext(PathWay1f.Geometry)

The error is

no such column PathWay1f.Indoor_pathway

I checked PathWay1f table, it has Indoor_pathway column. Did I use the wrong method to reference data in another table?

PathWay1f and roads1f are almost same. The geometry can be considered as the primary key. PathWay1f has a column Indoor_pathway, but roads1f doesn't have. I just want to copy Indoor_pathway from PathWay1f to roads1f.

Upvotes: 0

Views: 422

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133360

You need the join

update roads1f 
set indoorpathway=( 
        select PathWay1f.Indoor_pathway  
        from PathWay1f
        where astext(roads1f.geometry)= astext(PathWay1f.Geometry))

Upvotes: 2

Related Questions