我有一個小問題,執行SQL查詢。SQL查詢不執行correcly(其中)
在我的BD我有3列(experimentID,的applicationID,意圖)
我想與experimentID = 3
我詢問一些具體的意圖是:
SELECT experimentID, applicationID, intent
from intents
WHERE experimentID = 3 AND intent='android.intent.action.AIRPLANE_MODE' OR intent='android.intent.action.ALL_APPS' OR intent='android.intent.action.ANSWER' OR intent='android.intent.action.APPLICATION_PREFERENCES' OR intent='android.intent.action.APPLICATION_RESTRICTIONS_CHANGED' OR intent='android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE' OR intent='android.intent.action.APP_ERROR' OR intent='android.intent.action.ASSIST' OR intent='android.intent.action.PHONE_STATE' OR intent='android.intent.action.ATTACH_DATA' OR intent='android.intent.ACTION_SCREEN_OFF' OR intent='android.intent.action.BATTERY_CHANGED' OR intent='android.intent.action.BATTERY_CHANGED_ACTION' OR intent='android.intent.action.BATTERY_LOW' OR intent='android.service.wallpaper.WallpaperService' OR intent='android.intent.action.QUICKBOOT_POWERON' OR intent='android.net.conn.CONNECTIVITY_CHANGE' OR intent='android.intent.action.BATTERY_OKAY' OR intent='android.intent.action.START_SMS_SERVICE' OR intent='android.app.action.ACTION_DEVICE_ADMIN_DISABLE_REQUESTED' OR intent='android.intent.action.BOOT_COMPLETED' OR intent='android.intent.action.BUG_REPORT' OR intent='android.intent.action.CALL' OR intent='android.intent.action.RESPOND_VIA_MESSAGE' OR intent='android.intent.action.CALL_BUTTON' OR intent='android.intent.action.CAMERA_BUTTON' OR intent='android.intent.action.CARRIER_SETUP';
問題是我也得到其他experimentID ...(不僅實驗ID = 3)
我認爲這是因爲查詢中的OR
,但如何我可以查詢得到experiementID = 3嗎?問題顯然在WHERE
感謝您的幫助!
你需要把括號中所有的意圖來解決這個 – ncdreamy
所以,如果expirementID = 4將意圖值是相同的或者你有不同的名單?目標列表是否根據實驗ID而有所不同? – xQbert