Left Join in SQL

Asked

Viewed 58 times

3

SELECT SUM(TAXAS) FROM DOCUMENTO
LEFT JOIN PARCELAS PARCELA IN
(PARCELA.CODE = DOCUMENTO.CODE)
WHERE PARCELAS.FATURADAS = TRUE

I’m getting a syntax error I can’t fix

2 answers

4


SELECT SUM(DOC.TAXAS) FROM DOCUMENTOS DOC
LEFT JOIN PARCELAS PARCELA ON
(PARCELA.CODE = DOC.CODE)
WHERE PARCELAS.FATURADAS = 1

You put IN when it should be ON and it should be 1 instead of true This Where thing I didn’t realize, so you can take Ricardo’s answer as correct

  • Thank you! I didn’t realize, what a shame..

4

  • 1

    @Diegorafaelsouza Better write your suggestion as an additional answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.