Left outer join to itself to find outliers?
Try the following query. 

SELECT t1.ItemType, t2.Itemtype, COUNT(t1.X)
FROM Tab t1, Tab t2
WHERE
    t1.ItemType &lt; t2.ItemType
    AND ABS(t1.X - t2.X) &gt; 2
GROUP BY t1.ItemType, t2.Itemtype
;


It should produce the following results.

+----------+----------+-------------+
| ItemType | ItemType | COUNT(t1.X) |
+----------+----------+-------------+
|     1    |     2    |      7      |
+----------+----------+-------------+