K
K
Kir Mozor2020-12-09 17:46:09
Python
Kir Mozor, 2020-12-09 17:46:09

Select multiple conditions in SQLite query?

I need to select several conditions when querying in the SQLite db
In the db, the following information:
5fd0e6139a49d962908394.png
It is necessary to select 1 id with the condition that game_is_true = "True" AND game_is_true2 = "False" and not select the first id if my id matches the found id from the query
How to do this

my_id = 766745647564#Допустим что равняется 766745647564
cursor.execute('SELECT id FROM users WHERE game_is_true = "True" AND game_is_true2 = "False" NOT {}', (my_id,))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-12-09
@150_Kirill_150

cursor.execute('SELECT id FROM users 
WHERE game_is_true = "True" 
AND game_is_true2 = "False" 
AND id != ?', (my_id,))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question