Using Multiple WHERE Conditions In Single SQL Query
I'm wondering if there's a way to use WHERE condition in SQL more than once. Here's what I'm trying to achieve:-
Get the output in following format:-
[Username] [Article Contributed Last Month] [Total Articles Contributed]
Those are the columns, with the last column trying to pull the count of all articles contributed irrespective of the time. My query looks like this: -
SELECT xyz AS username, COUNT(abc) As count_last_month FROM pqr INNER JOIN ... ON .... WHERE category = 2 AND date = ...condition to select dates in the last month
This query totally ignores the third column, where I need to fetch the total count of articles. For this, I should have to add another WHERE condition where I tweak the date = to get data for all the dates; not just the last month.
Can someone tell me how to do that?