복붙노트

[SQL] PostgreSQL의 열을 찾을 수 없습니다, 그러나 쇼가에 설명

SQL

PostgreSQL의 열을 찾을 수 없습니다, 그러나 쇼가에 설명

이 유사한 게시물 있었지만 아무도 내 문제를 해결 도움이 없다.

나는 간단한 단 하나의 열을 검색, 테이블에 선택하려고 노력하고있다. 의 열 쇼 테이블을 설명하는,하지만 난 그것을 선택하려고 할 때 나는 열을 찾을 수 없습니다 오류가 발생합니다. 나는 명령 줄 인터페이스를 사용하고 있습니다.

표:

 id                        | integer                  | not null default 
 amazon_payment_id         | integer                  | not null
 source                    | character varying(10)    | not null
 timestamp                 | timestamp with time zone | not null
 status                    | character varying(50)    | not null
 statusReason              | character varying(100)   | not null
 transactionId             | character varying(50)    | not null
 transactionDate           | timestamp with time zone | 
 transactionAmount         | numeric(6,2)             | 
 errorMessage              | character varying(100)   | not null

기타

고르다:

select `transactionAmount` from ... where ... group by transactionAmount;

오류:

ERROR:  column "transactionamount" does not exist
LINE 1: select `transactionAmount` from ... where...

아무도 내가이 오류가 왜 어떤 생각을 가지고 있습니까?

해결법

  1. ==============================

    1.왜 열 이름에`사용합니까?

    왜 열 이름에`사용합니까?

    인용 문자는 대소 문자를 구분 될 수 있지만 당신은 어떤 따옴표없이 사용할 수 있습니다. 또한 인용 문자는` "입니다, 그리고

    사용 그래서 :

    select "transactionAmount" 
    from ... 
    where ... 
    group by "transactionAmount";
    

    http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html :에서 식별자에 대해 읽어보기

  2. from https://stackoverflow.com/questions/10613940/postgresql-column-not-found-but-shows-in-describe by cc-by-sa and MIT license