【发布时间】:2014-11-03 17:49:40
【问题描述】:
我的 sqlite3 数据库有问题,我执行以下查询
sqlite> select * from property where link like "http://www.domain.com/huur/den-bosch/appartement-48118689-meester-spoermekerlaan-88/";
我得到两行
17|2014-11-03|Meester Spoermekerlaan 88|http://www.domain.com/huur/den-bosch/appartement-48118689-meester-spoermekerlaan-88/|5237 JZ|登博世|€ 789|3|1
32|2014-11-03|Meester Spoermekerlaan 88|http://www.domain.com/huur/den-bosch/appartement-48118689-meester-spoermekerlaan-88/|5237 JZ|登博世|€ 789|3|1
然后我执行相同的查询,但使用相等运算符,就像这样
sqlite> 从属性中选择 * where 链接="http://www.domain.com/huur/den-bosch/appartement-48118689-meester-spoermekerlaan-88/";
sqlite>(
我已经找到了与我类似的答案,但问题不一样,我的字段是数据类型“文本”,您可以在此处看到:https://stackoverflow.com/a/14823565/279147
sqlite> .schema 属性
CREATE TABLE 属性(id integer PRIMARY KEY AUTOINCREMENT UNIQUE,"date" text,address text,link text,postcode text,city text,price text,rooms text,page integer);
那么有人知道为什么会发生这种情况吗?这是我的版本信息
root@s1:/# sqlite3 application.sqlite3
SQLite 版本 3.7.3
【问题讨论】:
-
SELECT DISTINCT typeof(link) FROM property;的输出是什么? -
那很奇怪.....它说“blob”,然后与另一个问题中所说的相关....但是 .schema 属性说“链接文本”,所以为什么两者之间的意见?他们不应该是一样的吗?或者可能是 sqlite3 做了一些优化?