• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 SQL query (view and post count)

fredrikse

Active member
#1
Hi,

I need help on two different SQL queries that I would like to run on my DB:

1. Retrieve the top 5 threads for year 2014 which have been viewed the most?

2. Retrieve the top 5 threads for year 2014 which have most answers?

Thanks,

Fredrik
 

Jim Boy

Well-known member
#2
I'm not sure about 1.1, but you can try
Code:
SELECT thread_id, title, reply_count from xf_thread where post_date>unix_timestamp('2014-01-01') order by 3 desc limit 5
and
Code:
SELECT thread_id, title, view_count from xf_thread where post_date>unix_timestamp('2014-01-01') order by 3 desc limit 5