SQL does not work, where [closed]

0
SELECT id, date_start, date_end as "ID" 
FROM project_task a
inner join project_task_type b
where a.date_start is not NULL and a.date_end is NULL

Give error in where

    
asked by user72608 17.12.2018 в 10:17
source

2 answers

1

As indicated by @Fly, you have to add the condition to the INNER JOIN

SELECT id, date_start, date_end as "ID" 
FROM project_task a
inner join project_task_type b ON b.id=a.id_task_type
where a.date_start is not NULL and a.date_end is NULL

The part of ON b.id = a.id_task_type is the key missing from your query

    
answered by 17.12.2018 / 11:13
source
4

The error is that you do not have a ON clause in JOIN

It should be something like:

SELECT id, date_start, date_end as "ID" 
FROM project_task a
inner join project_task_type b ON b.id=a.id_task_type
where a.date_start is not NULL and a.date_end is NULL

You can check the syntax of JOIN in the official documentation: link

    
answered by 17.12.2018 в 10:48