Closed JonPGrewer closed 4 years ago
Hmmm, I think this is working as designed, and what you're looking for is to use the equal sign =
before the number. eg =1
, =2
, etc.
If it helps, our filtering page on the wiki kind of covers this:
https://github.com/sqlitebrowser/sqlitebrowser/wiki/Using-the-Filters
It doesn't mention type information exactly, but as mentioned above I think the equals sign piece is the initial bit to read. :smile:
Thank you so much for that pointer. As you said, the page does indicate that. What confused me is that the sqlite documentation specifically says that you can't use "like" on a numeric value, only on text. However, I found elsewhere that it is possible to "cast" numeric fields as text, as in sql, for the purpose of doing a "like" search on integers and floats. Thanks so much again.
-Jon G
Thanks for the help again! I am closing this issue.
You're welcome @JonPGrewer. :smile:
Details for the issue
I have a table with several integer fields. When I put a value in the filter field it returns all records that have that digit or digits in them. in other words: t1.id = integer I have records like the following: 24 42 84 92
In Browse Data, If I put a value of 2 in the filter it returns 24, 42, 92. If I put a value of 4 in the filter it returns 24, 42, 84.
But I have confirmed that the data type is integer when I read the records out. It is treating these fields as though they are text and doing a "like" clause with the filter value. Is this as designed?
Kind regards, Jon G.
What did you do?
BEGIN TRANSACTION; CREATE TABLE IF NOT EXISTS "tblPops" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, "itemno" TEXT, "series" TEXT, "description" TEXT, "date" TEXT, "price" REAL ); INSERT INTO "tblPops" ("id","itemno","series","description","date","price") VALUES (1,'199','Marvel Guardians of the Galaxy Vol 2','Gamora','2020-04-15 00:00:00',33.0), (2,'265','Marvel Spiderman Homecoming','Spiderman (Headphones)','2020-04-15 00:00:00',21.0), (3,'177','Overwatch','D.Va with Meka','2020-04-15 00:00:00',19.0); COMMIT;
What did you expect to see?
type "1" in price column filter in Browse mode. Price is type REAL. Expected to see no records since there are no exact matches of this numeric field. The same thing happens with integer columns.
What did you see instead?
Instead I saw two matches: 21.0 and 19.0
Useful extra information