ERROR: operator does not exist: character varying = integer
时间: 2024-02-02 08:04:15 浏览: 13
This error occurs when you try to compare a character varying (string) value with an integer value using the "=" operator. This operator is used for comparing values of the same data type.
To fix this error, you need to either convert the integer value to a string using the CAST function or convert the string value to an integer using the :: operator.
For example, if you have a table with a column named "name" of type character varying and you want to compare it with an integer value 10, you can use the following query:
SELECT * FROM my_table WHERE name = '10';
Alternatively, you can convert the integer value to a string and use it in the query:
SELECT * FROM my_table WHERE name = CAST(10 AS VARCHAR);
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.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)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)