[ERROR]- not all arguments converted during bytes formatting
时间: 2023-10-19 10:46:04 浏览: 89
根据您提供的错误消息,看起来是在使用`format()`方法时出现了问题。这个错误通常是由于在字符串中包含了字节类型的数据而导致的。
为了解决这个问题,您可以将参数转换为字符串类型。您可以使用`str()`函数来将参数转换为字符串类型,例如:
```python
union_query = """
SELECT s.id, s.create_time, s.update_time, s.ftype_id, s.active, s.user_id, s.platform, s.remark, s.inviter_id,
s.user_id, u.username AS username, s.inviter_id, u_inviter.username AS inviter_name
FROM {} AS s
LEFT JOIN system_user AS u ON s.user_id = u.id
LEFT JOIN system_user AS u_inviter ON s.inviter_id = u_inviter.id
WHERE (s.remark = ? OR ? IS NULL)
AND (s.ftype_id = ? OR ? IS NULL)
AND (s.user_id = ? OR ? IS NULL)
AND (s.inviter_id = ? OR ? IS NULL)
""".format(str(strategy))
```
通过将`str(strategy)`传递给`format()`方法,可以确保将表名转换为字符串类型。
希望这可以帮助您解决问题。如果问题仍然存在,请提供更多的信息,以便我可以更好地帮助您。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)