[Qgis-user] Query a joined layer

Nathan Woodrow madmanwoo at gmail.com
Fri Nov 4 05:37:31 PDT 2011


Hey James,

I think the problem might be that the query builder, when you press ok, is
setting the the layer subset via QgsDataProvider::setSubsetString(string).
How setSubSetString works is up to the provider. In your case the provider,
that you joined to, doesn't know anything about the other fields or how to
filter based on them so it just returns nothing.

QGIS itself doesn't have a SQL engine in it's own right all most everything
with querying, except for the basic stuff, is passed to the provider. I
have had a chat to a few of the devs and it is something I am considering
if and how it could be added to QGIS. Not something that I myself will be
able to do, way over my head, but more just getting the ideas out there and
maybe some will fund it.

Hopefully this will at lest let you understand what is happening.

- Nathan

On Fri, Nov 4, 2011 at 10:01 PM, James Stott
<James.Stott at npaconsult.co.uk>wrote:

> I have opened an Access table via an ODBC connection. This has allowed me
> to open the attribute table up in QGIS. I have then done a join to join my
> attribute and polygon data together. I can style the data using the joined
> fields, and they all show up in the attribute table and the identify tool.
> However I cannot use these fields in a query. ****
>
> ** **
>
> If I use the query builder the fields show in the fields list, and the
> values from the fields show in the field list. However all of my queries
> return no results.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20111104/e3b06998/attachment.html>


More information about the Qgis-user mailing list