所以我有这个sql,它有效:
cursor.execute('select * from video_title_difference where title like
%s order by provider desc limit %s offset %s',
('%' + search + '%', limit, offset))
但如果我将ORDER BY变量(现在是'provider')更改为变量,它根本不起作用:
cursor.execute('select * from video_title_difference where title like %s
order by %s limit %s offset %s',
('%' + search + '%', order_by, limit, offset))
它“有效”,但根本没有订购。我在这里做错了什么?