The "select trackid, name from tracks where name GLOB '*[^1-9]*';" query works as expected and does NOT include names with 1 thru 9 in them in SQLiteMan, a Linux/Ubuntu SQL manager. It uses SQLite as the DB backend.

The logic of any # chars but NOT 1 thru 9 plus any # chars means NOT 1,2,3,4,5,6,7,8 or 9 in name col.

This also works the same in the 'sqlitetutorial.net' example given.

The issue is not which works how; the issue is why the difference? I.e., consistency.

I have notified the 'sqlitetutorial.net' folks of the discrepancy.

I added the SQLite Manager tool to FireFox v 50.1.0 and it, too, omits any # 1-9 in the query results using " GLOB '*[^1-9]*' ".

How to resolve??

Thanks.


On 01/04/2017 06:53 AM, R Smith wrote:


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

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

Reply via email to