我正在尝试搜索sqlite文件中的所有字段(列),但我一直没有得到有效的结果。这是代码。我应该尝试不同的东西吗?
Select * From session
join sessiontype using(SESSIONTYPEID)
join camera on SESSION.[CameraID] = camera.CameraID
join chemicals on session.[DeveloperID] = chemicals.[ChemicalsID]
or session.[FixerID] = chemicals.[ChemicalsID]
join shop on session.[DEVELOPEDBYID] = shop.[ShopID]
join film on session.[FilmID] = film.[FilmID]
join vendor on film.[VendorID] = vendor.[VendorID]
where session.[Identifier] like('%agfa%')
or session.[Notes] like('%agfa%')
or sessiontype.[SessionTypeName] like('%agfa%')
or camera.[CameraName] like('%agfa%')
or chemicals.[ChemicalsName] like('%agfa%')
or session.[DeveloperTemp] like('%agfa%')
or session.[DeveloperTime] like('%agfa%')
or session.[FixerTemp] like('%agfa%')
or session.[FixerTime] like('%agfa%')
or shop.[ShopName] like('%agfa%')
or session.[StopBathTemp] like('%agfa%')
or session.[StopBathTime] like('%agfa%')
or vendor.[VendorName] like('%agfa%')
order by session.[Identifier], sessiontype.[SessionTypeName], session.[Date]
我只有一个包含'agfa'的条目。 以下行两次返回1个条目: 加入化学品会议。[DeveloperID] =化学品。[ChemicalsID] 或会话。[FixerID] =化学品。[ChemicalsID]
以下条目不返回任何结果: 加入化学品会议。[DeveloperID] =化学品。[ChemicalsID] AND session。[FixerID] = chemicals。[ChemicalsID]
删除该行会返回正确的1个条目。
答案 0 :(得分:0)
注意:OR和LIKE是非常昂贵的操作