[Qgis-user] Troubles with Join of two layers

chris hermansen clhermansen at gmail.com
Wed Mar 16 09:02:03 PDT 2022


Roland and list

On Wed, Mar 16, 2022, 01:20 Roland Spielhofer via Qgis-user <
qgis-user at lists.osgeo.org> wrote:

> Hi,
> I am trying to join two layers using the DB Manager.
> One layer is a shape file, one is a pure attribute table without geometry.
> I have two fields that are identical in both layers, which should be used
> for the join.
>
> The SQL statement goes like this:
>
> SELECT *
> FROM 210914_Joined_Ebenheit as a,
> 20210914_sqlbatch_20220315_161846_erfassungsdaten as b
>  WHERE
> a.Filename = b.Filename AND
> b.frameNr = b.Frame;
>
> What I get is the following error message:
>
> Query execution error on CREATE TEMP VIEW _tview AS SELECT *  FROM
> 210914_Joined_Ebenheit as a,
> 20210914_sqlbatch_20220315_161846_erfassungsdaten as b  WHERE a.Filename =
> b.Filename AND b.frameNr = b.Frame: 1 - unrecognized token:
> "210914_Joined_Ebenheit"
>
> I don't get the meaning of "unrecognized token" - What I am doing wrong?
> I have "Load as new layer" ticked on - I want a new layer.
>
> Any help appreciated!
>
> Regards,
> Roland
>

Maybe try putting the 2019_Joined_Ebenheit in double quotes because it
begins with a non letter?

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220316/1b30de8d/attachment.html>


More information about the Qgis-user mailing list