Sample for 7982283

0

Please login or register to vote for this query.

(click on this box to dismiss)

Enter Query Description

Stack Overflow

Q&A for programmers

-- Sample for 7982283
-- Enter Query Description

      
      SELECT 
             p.id, 
             p.Title,
             SUM(CASE WHEN v.postid IS NOT NULL THEN 1 ELSE 0 END)  AS tally
      FROM  
          posts p
          LEFT JOIN votes v
          ON v.postid = p.id
      WHERE p.title is not null
     
      GROUP BY
          p.id,
          p.Title

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached