जॉइन का उपयोग करके एक वैकल्पिक समाधान यहां दिया गया है:
SELECT COUNT(*)
FROM Table1_delta t1 LEFT JOIN Table1 t2
ON t1.pagename = t2.pagename
WHERE t2.status IS NULL OR t2.status = 1
यहाँ उपरोक्त क्वेरी से अस्थायी तालिका कैसी दिखती है:
+-----------+--------+
| pagename | status |
+-----------+--------+
| pagename1 | 2 | # this row is NOT counted
| pagename2 | 1 | # +1 this row has status = 1 and is counted
| pagename3 | null | # +1 this row has status = null and is counted
| pagename4 | null | # +1 this row is also null and is counted
+-----------+--------+
चल रहे डेमो के लिए नीचे दिया गया लिंक देखें।