cursor.execute('SELECT * from user where user_id = %(some_id)d', {'some_id': 1234})
records = cursor.fetchall()
#tips Post #489
2.04K
Трюк дня. SQL - Как подставить переменную в Select [psycopg2]