TheBigK
Well-known member
I wish to fetch data in the following format :
Username | articles_last_month | total_articles
Now, my query that lets me fetch the first two column looks like this :-
It totally ignores the third column, the total_articles for which I will have to create an option to the WHERE condition. I'm wondering if it's possible to do it in a single query than write a separate query just to get the third column values?
I tried appending 'AND' at the end of above query; but it creates an error.
Username | articles_last_month | total_articles
Now, my query that lets me fetch the first two column looks like this :-
Code:
SELECT username, COUNT (blah) as articles_last_month FROM xf_thread
INNER JOIN ....
ON ....
WHERE condition 1 AND date between (condition to choose first and last date of last month)
It totally ignores the third column, the total_articles for which I will have to create an option to the WHERE condition. I'm wondering if it's possible to do it in a single query than write a separate query just to get the third column values?
I tried appending 'AND' at the end of above query; but it creates an error.