I am absoltetly new to SQL and created my first three queries
The first without ISNULL provides a result, but there are several columns with NULL values for the sum.
Than I added ISNULL for the first column and it worked, so I add it to the other columns and receive the following error message:
SQL-Fehler [1]: [SQLITE_ERROR] SQL error or missing database (near "ISNULL": syntax error)
I removed the additional ISNULL and even the command with only one ISNULL is not working anymore.
I can't find the error. My request looks like this:
SELECT
TABLE1.WORK, PARTNER_ID, ISNULL(SUM(VIEWS),0), ISNULL(SUM(APPLICATION_VIEWS),0), ISNULL(SUM(APPLICATIONS),0)
FROM
TABLE1
LEFT JOIN TABLE2
ON TABLE2.WORK= TABLE1.WORK
LEFT JOIN TABLE3
ON TABLE2.CATEGORY_ID = TABLE3.ID
LEFT JOIN TABLE4
ON TABLE1.SOURCE_ID = TABLE4.ID
LEFT JOIN TABLE5
ON TABLE1.WORK = TABLE5.WORK
WHERE (TABLE3.Category='Foo'
OR TABLE3.Category='Bar')
AND TABLE4.NAME='phone'
GROUP BY
TABLE1.WORK