Using the Query Builder
Da Wikipedia, l'enciclopedia libera.
Il testo inglese è tratto dal
sito ufficiale.
Come collaborare alla traduzione
Il Query Builder di PostgreSQL vi permette di definire un sottoinsieme di una tabella e di aggiungerlo come livello in QGIS. Per esempio, se avete un livello delle città con un campo della popolazione potreste selezionare soltanto i grandi agglomerati urbani registrando la popolazione > 100000 nella finestra di SQL del Query Builder. La figura 4.3 mostra un esempio del Query Builder popolato con i dati da un livello in PostgreSQL.
Figura: Query Builder Di PostgreSQL
Il Query Builder elenca i campi del database dello strato nella finestra di riepilogo a sinistra. Potete ottenere un campione dei dati contenuti nel campo evidenziato facendo click sul tasto "Campione". Questo richiama i primi 25 valori distinti per il campo dal database. Per ottenere una lista di tutti i valori possibili per un campo, fare click sopra il tasto "Tutto". Per aggiungere un campo o un valore selezionato alla Query Builder, fare doppio click su esso. Potete utilizzare i vari tasti per costruire la Query o potete scriverli nella finestra di SQL.
Per verificare una domanda, fare click sopra il tasto "Prova". Ciò restituirà un conteggio del numero di annotazioni che saranno incluse nella query. Una volta soddisfatto del risultato, fare click su "ok". L'SQL per la clausola "where", sarà indicata nella colonna SQL della lista dello strato.
The PostgreSQL Query Builder allows you to define a subset of a table and add it as a layer in QGIS. For example, if you have a towns layer with a population field you could select only larger towns by entering population > 100000 in the SQL box of the query builder. Figure [*] shows an example of the query builder populated with data from a layer in PostgreSQL.
Figure: PostgreSQL Query Builder
The query builder lists the layer's database fields in the list box on the left. You can get a sample of the data contained in the highlighted field by clicking on the Sample button. This retrieves the first 25 distinct values for the field from the database. To get a list of all possible values for a field, click on the All button. To add a selected field or value to the query, double-click on it. You can use the various buttons to construct the query or you can just type it into the SQL box.
To test a query, click on the Test button. This will return a count of the number of records that will be included in the layer. When satisfied with the query, click Ok. The SQL for the where clause will be shown in the SQL column of the layer list.

