Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I do this:</p> <pre><code>SELECT distinct t442.c1, count(distinct t631.c536870922), count (distinct t649.c536870931) FROM t442, t658, t631, t649 WHERE t442.c1 = t658.c536870930 AND t442.c200000003 = 'Network' AND t442.c536871139 &lt; 2 AND t631.c536870913 = t442.c1 AND t658.c536870925 = 1 AND (t442.c7 = 6 OR t442.c7 = 5) AND t442.c536870954 &gt; 1141300800 AND (t442.c240000010 = 0) AND t442.c1 = t649.c536870914 AND t649.c536870939 &gt; 1 group by t442.c1 having count(distinct t631.c536870922)= count (distinct t649.c536870931) </code></pre> <p>I see the 23 rows that should be counted. Removing the HAVING statement returns 24 rows, the extra one which does not meet that HAVING criteria.</p> <p>EDIT: Results of the query, as requested per Steve Broberg:</p> <pre> row | t442.c1 | cnt t631 | cnt 649 ------------------------------------------- 1 | CHG000000230378 | 2 | 1 2 | CHG000000230846 | 1 | 1 3 | CHG000000232562 | 1 | 1 4 | CHG000000232955 | 1 | 1 5 | CHG000000232956 | 1 | 1 6 | CHG000000232958 | 1 | 1 7 | CHG000000233027 | 1 | 1 8 | CHG000000233933 | 1 | 1 9 | CHG000000233934 | 1 | 1 10 | CHG000000233997 | 1 | 1 11 | CHG000000233998 | 1 | 1 12 | CHG000000233999 | 1 | 1 13 | CHG000000234001 | 1 | 1 14 | CHG000000234005 | 1 | 1 15 | CHG000000234009 | 1 | 1 16 | CHG000000234012 | 1 | 1 17 | CHG000000234693 | 1 | 1 18 | CHG000000234696 | 1 | 1 19 | CHG000000234730 | 1 | 1 20 | CHG000000234839 | 1 | 1 21 | CHG000000235115 | 1 | 1 22 | CHG000000235224 | 1 | 1 23 | CHG000000235488 | 1 | 1 24 | CHG000000235847 | 1 | 1 </pre> <p>The first row is filtered out properly if I include the HAVING clause.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload