Jump to content
Fórum Script Brasil
  • 0

ERRO 42P01


maciel vicente da silva
 Share

Question

Prezados,

Não estou conseguindo resolver o erro abaixo. Alguém pode me ajudar. Antecipadamente agradeço.

SQL

SELECT 
  "TABELA1".id, 
  "TABELA3".id
FROM 
  public."TABELA1", 
  public."TABELA3";

SELECT
    "TABELA1".id,
    SUM(CASE WHEN "TABELA1"."B01" = "TABELA3"."B01" THEN 1 ELSE 0 END)  +
    SUM(CASE WHEN "TABELA1"."B02" = "TABELA3"."B02" THEN 1 ELSE 0 END)  +
    SUM(CASE WHEN "TABELA1"."B03" = "TABELA3"."B03" THEN 1 ELSE 0 END)  
FROM
    public."TABELA1" AS T1
    LEFT JOIN "TABELA3".id AS T3 ON
        T1.ID = T3.ID

__________________________________________________

ERRO

ERROR:  relation "TABELA3.id" does not exist
LINE 17:     LEFT JOIN "TABELA3".id AS T3 ON
                       ^
********** Error **********

ERROR: relation "TABELA3.id" does not exist
SQL state: 42P01
Character: 399
 

OBJETIVO DA QUERY

 



GetInline.aspx?messageid=a34f72cf-ed15-1

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

 

você tem duas opções: - usar sem aspas: então tudo será automaticamente minúsculas e não diferencia maiúsculas de minúsculas - ou usando aspas tudo passa a ser case sensitive .

é  recomendado não usar aspas e fazer o PostgreSQL se comportar não diferenciando maiúsculas de minúsculas. isso torna a vida muito mais fácil.

alguns exemplos:

  TEST = test <-- non case sensitive "Test" <> Test <-- first is precise, second one is turned to lower case "Test" = "Test" <-- will work "test" = TEST <-- should work; but you are just lucky. 

abraço

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      149.6k
    • Total Posts
      646.2k
×
×
  • Create New...