[Gfoss] SpatiaLite conteggio righe tabelle database

pigreco pigrecoinfinito a gmail.com
Mar 30 Apr 2019 08:36:01 CEST


a.furieri wrote
>>
>> Ci riesco con questa, ma sembra bruttina:
>>
>> SELECT tbl_name,
>>        eval('select count(*) from ' || tbl_name ) AS nro_righe
>> FROM sqlite_master
>> where type='table'
>> and name not like '%geom%'
>> and name not like '%spatial%'
>> and name not like '%sql%'
>> and name not like '%raster%'
>> and name not like '%SE%'
>> and name not like '%vector_%'
>> and sql not like '%geom%';
>>
> 
> SELECT tbl_name,
>         eval('SELECT count(*) FROM "' || tbl_name || '"') AS nro_righe
> FROM sqlite_master
> WHERE type='table'
> AND name NOT IN (SELECT f_table_name FROM geometry_columns)
> ORDER BY tbl_name;
> 
> ciao Sandro

Buongiorno e grazie per la risposta,
la query proposta ottiene tutte le tabelle del database tranne quelle con
geometry e quindi prende anche quelle tabelle del database che non ho creato
direttamente io, es: prende le tabelle idx..., SE.... ecc...
il mio intendo era quello di 'acchiappare' solo le tabelle che ho creato e
popolato io.

saluti

-----
https://pigrecoinfinito.wordpress.com/
--
Sent from: http://gfoss-geographic-free-and-open-source-software-italian-mailing.3056002.n2.nabble.com/


Maggiori informazioni sulla lista Gfoss