Sorry for the double email. Also, I wonder how much we could extract from EXPLAIN SELECT * FROM view; (alternatively EXPLAIN SELECT * FROM view WHERE field1 = 1;) and if we could tease information out of that.
This all seems more complicated than it needs to be though. Jim On 09/04/2015 02:42 AM, Andrea Peri wrote: > Ho, > How do qgis to analyze the table to retrieve the unique? > A loop on every record or a SQL to count distinct ? > > A. > > Il 04/set/2015 08:01, "Bernhard Ströbl" <bernhard.stro...@jena.de > <mailto:bernhard.stro...@jena.de>> ha scritto: > > > > Am 03.09.2015 um 23:41 schrieb Sandro Santilli: > > On Wed, Sep 02, 2015 at 08:48:34AM +0200, Bernhard Ströbl wrote: > > Am 01.09.2015 um 17:49 schrieb Matthias Kuhn: > > > > 2. If there are tables without a PK open a second modal > dialog with an > explanation of the problem and offer to select a pk from > a combobox. > > > I hope you mean "relation" not table, a table should always > have a > PK. > > > It's not mandatory for a table to have a PK. > I guess by "tables without a PK" he means table for which no PRIMARY > KEY constraint is explicitly defined (should an UNIQUE key be > considered equally valid?). > > > It is not mandatory, of course, that's why I wrote "should", but > IMHO it is very bad database design to not define one. > There might be several UNIQUE constraints on one table but there can > be only one PK constraint. So in case of only a UINIQUE constraint > the table would be handled as any other without PK constraint (or > QGIS needs to analyse how many fields have a UNIQUE constraint). > > Bernhard > > > __________ Information from ESET Mail Security, version of virus > signature database 12200 (20150904) __________ > > The message was checked by ESET Mail Security. > http://www.eset.com > > > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org <mailto:Qgis-user@lists.osgeo.org> > http://lists.osgeo.org/mailman/listinfo/qgis-user > > > > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/qgis-user > _______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user