On 9/14/2011 15:29, Jay A. Kreibich wrote:
Most RDBMS systems will throw an error if you don't group or
aggregate column references, but SQLite trust you to know what you're
doing. Personally I've always found this to be very useful, as I
often have queries that lead to great frustation on other systems.
When I know a computed column or something similar is unique (or
unique enough, such as only caps differences), it is nice to be
able to keep the groupings simple.
-j
Thanks Jay and others for very thoughtful answers. My personal
preference would be for a (perhaps optional) strict enforcement
of the syntax, supplemented by two aggregate functions:
choose_one() :
Chooses one value, could be identical to current behavior,
but make it explicit.
all_identical() :
Returns the value of the column if there is only one distinct
value there. Otherwise it will throw an error. I find this
use-case, which is the one Jay mentioned, very useful, but
sometimes it is very important to guard against insane data.
Having SQLite automatically figure out if a non-grouped column
is actually guaranteed to be unique seems useful, but probably
more involved than a pragma simply implementing this restriction
in all cases.
Anyway, since this is not something that can be changed currently,
I'll find a way to work around this.
Best,
Magnus
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users