On 2017/01/04 7:17 AM, Ken Wagner wrote:
About 2/3 the way down the page at:

http://www.sqlitetutorial.net/sqlite-glob/       Get names without [1-9].

select trackid, name from tracks where name GLOB '*[^1-9]*';

Works properly in SQLiteMan and the SQLite Tutorial. ( Two different products, not officially part of sqlite.org, I think, but use the sqlite app.)

    But not in sqlite3 3.15.1 and 3.16.1.


That should not "work" in ANY version of SQLite (depending on what you mean by "work"). The phrase '*[^1-9]*' essentially asks to match 'Anything, followed by something that is NOT a character 1 through 9, followed by Anything again' which is really ANYTHING that isn't specifically an integer which doesn't contain zeroes. i.e. it will exclude a name like "1996" but not a name like "2016" or "123.456", so in the Chinook database (which the tutorial uses) the query will list ALL thousands of names except one (namely a song titled: "1979") so it would be hard for you to differentiate between the query that "works" and one that doesn't.

Perhaps suggest to the Tutorial creators to use phrases like '*[^0-9]*' in stead of 1-9 to start with, and then maybe an example that has more than one single exclusion across the entire DB (which make the results seem superfluous and not very educational).

Another confusing bit is your claim that it "works" in an earlier version and not in the newer versions - I get the same results in 3.9 and 3.16.
May I ask how it differs for you?


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to