﻿{"id":14177,"date":"2025-06-18T10:00:00","date_gmt":"2025-06-18T08:00:00","guid":{"rendered":"https:\/\/www.sigterritoires.fr\/?p=14177"},"modified":"2025-06-11T08:07:59","modified_gmt":"2025-06-11T06:07:59","slug":"qgis-a-new-sql-query-option-in-the-layer-context-menu","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/","title":{"rendered":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Starting with QGIS version 3.42, a subtle but powerful feature has been added to the <strong>context menu of vector layers<\/strong>: the <strong>\u201cSQL Query\u2026\u201d<\/strong> option.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This improvement provides a <strong>direct and user-friendly interface for running SQL queries<\/strong>, without needing to open the Processing Toolbox or the DB Manager.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contenu <\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#A_Simple_but_Valuable_Addition\" >A Simple but Valuable Addition<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#Simple_Example_Select_Parcels_Over_One_Hectare\" >Simple Example: Select Parcels Over One Hectare<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#Spatial_Example_Parcels_Within_200_m_of_Rivers\" >Spatial Example: Parcels Within 200 m of Rivers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#Practical_Tips\" >Practical Tips<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#A_Great_Time-Saver_for_Advanced_Users\" >A Great Time-Saver for Advanced Users<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#In_Summary\" >In Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"A_Simple_but_Valuable_Addition\"><\/span> A Simple but Valuable Addition<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Right-clicking on a vector layer (whether from a database or a local file like a <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/geopackage-format-and-qgis-3\/\">GeoPackage<\/a>) now shows a new entry: <strong>SQL Query\u2026<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"307\" data-attachment-id=\"14178\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/requete_sql_menu_couches-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?fit=2560%2C1227&amp;ssl=1\" data-orig-size=\"2560,1227\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"requete_sql_menu_couches\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?fit=640%2C307&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1.jpg?resize=640%2C307&#038;ssl=1\" alt=\"\" class=\"wp-image-14178\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?resize=1024%2C491&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?resize=300%2C144&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?resize=768%2C368&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?resize=1536%2C736&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?resize=2048%2C982&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This command opens a lightweight SQL editor window where you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Filter features<\/strong> by attributes or geometry,<\/li>\n\n\n\n<li><strong>Generate new geometries<\/strong> (buffer, intersection, etc.),<\/li>\n\n\n\n<li><strong>Perform aggregations<\/strong> (sum, count, average, etc.).<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">The functionality is powered by <strong>QGIS SQL<\/strong>, a flexible engine that works with both local datasets and remote spatial databases (e.g., <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/starting-with-postgres-postgis\/\">PostGIS<\/a>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The result of the query is displayed in a dedicated window as a list of records matching the specified criteria. You can review the results directly, but more importantly, by using the <strong>\u201cLoad as new layer\u201d<\/strong> option, the query result can be added as a <strong>virtual layer<\/strong> in the <em>Layers<\/em> panel. This allows you to reuse the filtered dataset instantly, without duplicating data, and with the flexibility of dynamic access to your selection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This layer is <strong>temporary <\/strong>and not saved by default. If you wish to keep it or use it in another project, you can then <strong>save it manually<\/strong> in a format of your choice (GeoPackage, <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/shapefile-vs-geopackage\/\">Shapefile<\/a>, etc.) by right-clicking &gt; \u201cExport\u201d.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Simple_Example_Select_Parcels_Over_One_Hectare\"><\/span>Simple Example: Select Parcels Over One Hectare<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here&rsquo;s a basic query that selects only the parcels larger than 10,000 m\u00b2 (1 hectare):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT *\nFROM cadastre_rodrigues\nWHERE ST_Area(geometry) &gt; 10000\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This returns a subset of the features, directly viewable and usable in your map project.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Spatial_Example_Parcels_Within_200_m_of_Rivers\"><\/span>Spatial Example: Parcels Within 200 m of Rivers<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you have a <code>rivieres_rodrigues<\/code> layer loaded, you can find intersections with a 200 m buffer around the rivers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT \n  p.id,\n  ST_Intersection(p.geometry, ST_Union(ST_Buffer(r.geometry, 200))) AS geometry\nFROM cadastre_rodrigues AS p,\n     rivieres_rodrigues AS r\nWHERE ST_Intersects(p.geometry, ST_Buffer(r.geometry, 200))\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This query returns the <strong>actual intersected geometries<\/strong>, not the entire parcel.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"340\" data-attachment-id=\"14183\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/requete_sql_intersection\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?fit=2560%2C1360&amp;ssl=1\" data-orig-size=\"2560,1360\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"requete_sql_intersection\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?fit=640%2C340&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection.jpg?resize=640%2C340&#038;ssl=1\" alt=\"\" class=\"wp-image-14183\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?resize=1024%2C544&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?resize=300%2C159&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?resize=768%2C408&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?resize=1536%2C816&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?resize=2048%2C1088&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_intersection-scaled.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_Tips\"><\/span>Practical Tips<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You must include a <code>geometry<\/code> column in your result for it to be displayed on the map.<\/li>\n\n\n\n<li>The SQL engine supports a wide range of spatial functions (<code>ST_Buffer<\/code>, <code>ST_Intersection<\/code>, <code>ST_Union<\/code>, <code>ST_Area<\/code>, etc.).<\/li>\n\n\n\n<li>Query results can be <strong>added to the project<\/strong>, <strong>saved as virtual layers<\/strong>, or <strong>exported to a new file<\/strong> (e.g., GeoPackage).<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"A_Great_Time-Saver_for_Advanced_Users\"><\/span> A Great Time-Saver for Advanced Users<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Previously, running SQL queries required opening:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <strong>DB Manager<\/strong> (for database layers),<\/li>\n\n\n\n<li>The <strong>Virtual Layer<\/strong> interface (for local file-based layers),<\/li>\n\n\n\n<li>Or the <strong>Processing Toolbox<\/strong> for spatial queries.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The new context menu command <strong>\u201cSQL Query\u2026\u201d<\/strong> streamlines this process and encourages experimentation and productivity.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"In_Summary\"><\/span> In Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This new option in the context menu is a <strong>welcome addition to QGIS<\/strong>. It bridges the gap between powerful SQL capabilities and everyday GIS workflows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By enabling direct access to SQL on any layer, <strong>QGIS empowers users to explore, transform, and filter data more efficiently<\/strong>, without needing to write full scripts or run multiple tools.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":14178,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1377],"tags":[3001,3298,1386,1353],"class_list":["post-14177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-qgis-en","tag-layers","tag-menu-en","tag-qgis-en","tag-sql-en"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Atilio Francois\"\/>\n\t<meta name=\"google-site-verification\" content=\"ByXHZUbGNn7RNv-Xk5A-ysTZrM65VLIO2RxfSJ2nIEQ\" \/>\n\t<meta name=\"keywords\" content=\"layers,menu,qgis,sql\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"fr_FR\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Blog SIG &amp; Territoires | le portail des professionnels du SIG\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu | Blog SIG &amp; Territoires\" \/>\n\t\t<meta property=\"og:description\" content=\"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-06-18T08:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-06-11T06:07:59+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/atilio.francois\/\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@SigTerritoires\" \/>\n\t\t<meta name=\"twitter:title\" content=\"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu | Blog SIG &amp; Territoires\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@SigTerritoires\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#article\",\"name\":\"QGIS: A New \\u201cSQL Query\\u201d Option in the Layer Context Menu | Blog SIG & Territoires\",\"headline\":\"QGIS: A New \\u201cSQL Query\\u201d Option in the Layer Context Menu\",\"author\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.sigterritoires.fr\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/requete_sql_menu_couches-1-scaled.jpg?fit=2560%2C1227&ssl=1\",\"width\":2560,\"height\":1227},\"datePublished\":\"2025-06-18T10:00:00+02:00\",\"dateModified\":\"2025-06-11T08:07:59+02:00\",\"inLanguage\":\"fr-FR\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#webpage\"},\"articleSection\":\"QGis, Layers, menu, qgis, sql, English\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sigterritoires.fr\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/category\\\/qgis-en\\\/#listItem\",\"name\":\"QGis\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/category\\\/qgis-en\\\/#listItem\",\"position\":2,\"name\":\"QGis\",\"item\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/category\\\/qgis-en\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#listItem\",\"name\":\"QGIS: A New \\u201cSQL Query\\u201d Option in the Layer Context Menu\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#listItem\",\"position\":3,\"name\":\"QGIS: A New \\u201cSQL Query\\u201d Option in the Layer Context Menu\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/category\\\/qgis-en\\\/#listItem\",\"name\":\"QGis\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#person\",\"name\":\"Atilio Francois\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Atilio Francois\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/\",\"name\":\"Atilio Francois\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Atilio Francois\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#webpage\",\"url\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/\",\"name\":\"QGIS: A New \\u201cSQL Query\\u201d Option in the Layer Context Menu | Blog SIG & Territoires\",\"description\":\"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \\u201cSQL Query\\u2026\\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a\",\"inLanguage\":\"fr-FR\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.sigterritoires.fr\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/requete_sql_menu_couches-1-scaled.jpg?fit=2560%2C1227&ssl=1\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#mainImage\",\"width\":2560,\"height\":1227},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/en\\\/qgis-a-new-sql-query-option-in-the-layer-context-menu\\\/#mainImage\"},\"datePublished\":\"2025-06-18T10:00:00+02:00\",\"dateModified\":\"2025-06-11T08:07:59+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#website\",\"url\":\"https:\\\/\\\/www.sigterritoires.fr\\\/\",\"name\":\"Blog SIG & Territoires\",\"description\":\"le portail des professionnels du SIG\",\"inLanguage\":\"fr-FR\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu | Blog SIG & Territoires","description":"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a","canonical_url":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/","robots":"max-image-preview:large","keywords":"layers,menu,qgis,sql","webmasterTools":{"google-site-verification":"ByXHZUbGNn7RNv-Xk5A-ysTZrM65VLIO2RxfSJ2nIEQ","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#article","name":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu | Blog SIG & Territoires","headline":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu","author":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.sigterritoires.fr\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?fit=2560%2C1227&ssl=1","width":2560,"height":1227},"datePublished":"2025-06-18T10:00:00+02:00","dateModified":"2025-06-11T08:07:59+02:00","inLanguage":"fr-FR","mainEntityOfPage":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#webpage"},"isPartOf":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#webpage"},"articleSection":"QGis, Layers, menu, qgis, sql, English"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr#listItem","position":1,"name":"Home","item":"https:\/\/www.sigterritoires.fr","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/category\/qgis-en\/#listItem","name":"QGis"}},{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/category\/qgis-en\/#listItem","position":2,"name":"QGis","item":"https:\/\/www.sigterritoires.fr\/index.php\/en\/category\/qgis-en\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#listItem","name":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#listItem","position":3,"name":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu","previousItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/category\/qgis-en\/#listItem","name":"QGis"}}]},{"@type":"Person","@id":"https:\/\/www.sigterritoires.fr\/#person","name":"Atilio Francois","image":{"@type":"ImageObject","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g","width":96,"height":96,"caption":"Atilio Francois"}},{"@type":"Person","@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author","url":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/","name":"Atilio Francois","image":{"@type":"ImageObject","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g","width":96,"height":96,"caption":"Atilio Francois"}},{"@type":"WebPage","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#webpage","url":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/","name":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu | Blog SIG & Territoires","description":"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a","inLanguage":"fr-FR","isPartOf":{"@id":"https:\/\/www.sigterritoires.fr\/#website"},"breadcrumb":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#breadcrumblist"},"author":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?fit=2560%2C1227&ssl=1","@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#mainImage","width":2560,"height":1227},"primaryImageOfPage":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/#mainImage"},"datePublished":"2025-06-18T10:00:00+02:00","dateModified":"2025-06-11T08:07:59+02:00"},{"@type":"WebSite","@id":"https:\/\/www.sigterritoires.fr\/#website","url":"https:\/\/www.sigterritoires.fr\/","name":"Blog SIG & Territoires","description":"le portail des professionnels du SIG","inLanguage":"fr-FR","publisher":{"@id":"https:\/\/www.sigterritoires.fr\/#person"}}]},"og:locale":"fr_FR","og:site_name":"Blog SIG &amp; Territoires | le portail des professionnels du SIG","og:type":"article","og:title":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu | Blog SIG &amp; Territoires","og:description":"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a","og:url":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/","article:published_time":"2025-06-18T08:00:00+00:00","article:modified_time":"2025-06-11T06:07:59+00:00","article:publisher":"https:\/\/www.facebook.com\/atilio.francois\/","twitter:card":"summary","twitter:site":"@SigTerritoires","twitter:title":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu | Blog SIG &amp; Territoires","twitter:description":"Starting with QGIS version 3.42, a subtle but powerful feature has been added to the context menu of vector layers: the \u201cSQL Query\u2026\u201d option. This improvement provides a direct and user-friendly interface for running SQL queries, without needing to open the Processing Toolbox or the DB Manager. A Simple but Valuable Addition Right-clicking on a","twitter:creator":"@SigTerritoires"},"aioseo_meta_data":{"post_id":"14177","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2025-06-10 19:56:21","updated":"2025-06-18 08:11:39","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sigterritoires.fr\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/category\/qgis-en\/\" title=\"QGis\">QGis<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tQGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.sigterritoires.fr"},{"label":"QGis","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/category\/qgis-en\/"},{"label":"QGIS: A New \u201cSQL Query\u201d Option in the Layer Context Menu","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-a-new-sql-query-option-in-the-layer-context-menu\/"}],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/06\/requete_sql_menu_couches-1-scaled.jpg?fit=2560%2C1227&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-3GF","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/14177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=14177"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/14177\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media\/14178"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=14177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=14177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=14177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}