postgresql-count

0

Please login or register to vote for this query.

(click on this box to dismiss)

Game Development Meta

Q&A about the site for professional and independent game developers

SELECT 
    YEAR(p.CreationDate) AS Year,
    t.TagName,
    SUM(p.ViewCount) AS TotalViews
FROM 
    Posts p
JOIN 
    PostTags pt ON p.Id = pt.PostId
JOIN 
    Tags t ON pt.TagId = t.Id
WHERE 
    t.TagName IN ('postgresql', 'sql-server')
GROUP BY 
    YEAR(p.CreationDate),
    t.TagName
ORDER BY 
    Year,
    t.TagName;


SELECT DISTINCT TagName
FROM Tags
WHERE TagName LIKE '%sql%'
ORDER BY TagName;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results