Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android SQLite不喜欢工作不正常_Android_Sqlite - Fatal编程技术网

Android SQLite不喜欢工作不正常

Android SQLite不喜欢工作不正常,android,sqlite,Android,Sqlite,我在SQLite中使用一个大型复杂的数据库。我正在尝试创建一个查询,以获取所有正在繁殖的母羊,即未标记为Sell或Butcher的母羊 我使用一个名为alert01的字段来包含扫描和查找绵羊时需要注意的数据。一只待售的羊会被卖掉还是卖掉?在那个领域的某个地方。一只能去屠宰场的羊会有屠夫还是屠夫?在那个领域。有些羊在它们的警告文本字段中都有,因为它们要么去屠宰,要么被卖掉 此查询将正确查找农场上所有待售或待售的成年母羊: SELECT sheep_table.sheep_id, sheep_t

我在SQLite中使用一个大型复杂的数据库。我正在尝试创建一个查询,以获取所有正在繁殖的母羊,即未标记为Sell或Butcher的母羊

我使用一个名为alert01的字段来包含扫描和查找绵羊时需要注意的数据。一只待售的羊会被卖掉还是卖掉?在那个领域的某个地方。一只能去屠宰场的羊会有屠夫还是屠夫?在那个领域。有些羊在它们的警告文本字段中都有,因为它们要么去屠宰,要么被卖掉

此查询将正确查找农场上所有待售或待售的成年母羊:

SELECT sheep_table.sheep_id, 
 sheep_table.sheep_name, sheep_table.birth_date, 
sire_table.sheep_name as sire_name, dam_table.sheep_name as dam_name , sheep_table.alert01
FROM sheep_table 
left join sheep_table as sire_table on sheep_table.sire_id = sire_table.sheep_id
left join sheep_table as dam_table on sheep_table.dam_id = dam_table.sheep_id
WHERE sheep_table.remove_date is ''
and sheep_table.sex = 2
and sheep_table.birth_date not like "2014%"
and (sheep_table.alert01  like '%Butcher%' or sheep_table.alert01  like '%Sell%')
order by  sheep_table.sheep_name asc
这只羊找不到非卖品或屠宰羊,我不明白为什么

SELECT sheep_table.sheep_id, 
 sheep_table.sheep_name, sheep_table.birth_date, 
sire_table.sheep_name as sire_name, 
dam_table.sheep_name as dam_name, sheep_table.alert01
FROM sheep_table 
left join sheep_table as sire_table on sheep_table.sire_id = sire_table.sheep_id
left join sheep_table as dam_table on sheep_table.dam_id = dam_table.sheep_id
WHERE sheep_table.remove_date is ''
and sheep_table.sex = 2
and sheep_table.birth_date not like "2014%"
and (sheep_table.alert01 not like '%Butcher%' or sheep_table.alert01 not like '%Sell%')
order by  sheep_table.sheep_name asc
它几乎囊括了所有的羊,只剔除了那些既有卖羊又有屠夫的羊


我完全迷路了,对我来说,第二个查询只是第一个查询的补充,所以我不明白为什么它不能像我预期的那样工作

要正确反转条件,必须应用:


非常感谢。我很确定我在做一些愚蠢的事,非常感谢!
WHERE ... (alert01 NOT LIKE '%Butcher%' AND alert01 NOT LIKE '%Sell%') ...
                                        ^^^