add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table atendimento_regulacao(id int, vinculo_id int, data date)
create table vinculo(id int,usuario_id varchar(25))
INSERT INTO vinculo VALUES(1,2)
INSERT INTO atendimento_regulacao VALUES(5,1,'2019-07-01');
SELECT v.id, a.data start, case when count(*) is null then null end title
FROM atendimento_regulacao a
RIGHT JOIN vinculo v
ON v.id = a.vinculo_id
AND a.data = '2019-07-02'
GROUP BY v.usuario_id, a.data
id start title
1 null null