Answer the question
In order to leave comments, you need to log in
How to make a SELECT with two conditions?
Good afternoon.
Stuck on a simple select query
def get_referal(self, chat_id):
with self.conn:
self.cursor.execute('SELECT chat_id FROM profile WHERE ref = %s AND comp_name NOT IN ("No name");',
(chat_id,))
return self.cursor.fetchall()
Answer the question
In order to leave comments, you need to log in
Everything, he asked the question, he decided.
Who cares who will have the same error, you need to take out the value of the field in tuple
self.cursor.execute('SELECT chat_id FROM profile WHERE ref = %s AND comp_name != %s;', (chat_id, "No name"))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question