Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PostgreSQL-WHERE子句不起作用-未找到列名_Sql_Postgresql_String Literals - Fatal编程技术网

PostgreSQL-WHERE子句不起作用-未找到列名

PostgreSQL-WHERE子句不起作用-未找到列名,sql,postgresql,string-literals,Sql,Postgresql,String Literals,我的简单WHERE查询不起作用。它说列“Exception”不存在,但它键入的列只是一个值 SQL查询: select * from logs where type = "Exception" 正如S-Man评论的那样,答案是: “字符用于列名。您必须使用”字符。试试这个: SELECT * FROM logs WHERE type = 'Exception' “字符用于列名。您必须使用“字符。@S-Man更一般地说,双引号用于标识符,除了列名之外,还可以包括表名和数据库名。@L

我的简单WHERE查询不起作用。它说列“Exception”不存在,但它键入的列只是一个值

SQL查询:

select * from logs
where type = "Exception"

正如S-Man评论的那样,答案是:
字符用于列名。您必须使用
字符。

试试这个:

SELECT *
FROM
   logs
WHERE
   type = 'Exception'

字符用于列名。您必须使用
字符。@S-Man更一般地说,双引号用于标识符,除了列名之外,还可以包括表名和数据库名。@LukaszDabrowski:但是,区分大小写的列名需要双引号。您应该真正地重新创建该表,而不使用任何双引号。根据经验:在SQL中永远不要使用双引号