blob: 1d8bd0c1de22bb4193c6cab26b914cad4cdfa8bd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
PRAGMA DisableSimpleColumns;
/* postgres can not */
$input = (
select 2 as id,
3 as taskId,
4 as previousId
union all
select 1 as id,
null as taskId,
2 as previousId
);
SELECT count(*)
FROM $input AS diff
INNER JOIN $input AS taskSuite ON diff.previousId = taskSuite.id
LEFT JOIN $input AS pedestrian ON diff.taskId = pedestrian.id
WHERE
diff.id = 1
;
|