vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Average post count between 2 dates? (https://vborg.vbsupport.ru/showthread.php?t=151020)

Geraldm 06-30-2007 09:28 AM

Average post count between 2 dates?
 
Hi,

I need some help programming the following:

I need to get the top 10 forum members which have the highest average daliy post count between the 17th April 07 and the 18th of June 07.

If anyone can come up with some code to display this I am willing to pay $$ for your efforts :D

Thanks,
Gerald.

Eikinskjaldi 06-30-2007 10:27 AM

Quote:

Originally Posted by Geraldm (Post 1279791)
Hi,

I need some help programming the following:

I need to get the top 10 forum members which have the highest average daliy post count between the 17th April 07 and the 18th of June 07.

If anyone can come up with some code to display this I am willing to pay $$ for your efforts :D

Thanks,
Gerald.

[sql]
select userid, count(*) as 'total' from post
where dateline between (unix_timestamp('2007-04-17'), unix_timestamp('2007-06-18'))
group by userid order by total desc limit 10;
[/sql]

Geraldm 06-30-2007 01:06 PM

Hi,

Thanks, that works, although I had to modify it like so:
[sql]SELECT count(*) as 'total' from post
where dateline between UNIX_TIMESTAMP('2007-04-17 00:00:00')
and UNIX_TIMESTAMP('2007-06-18 23:59:59')
group by userid order by total desc limit 10;
[/sql]

But it only outputs on column called total .... how do I also display the userid ??

Cheers ....
Gerald.


Quote:

Originally Posted by Eikinskjaldi (Post 1279809)
[sql]
select userid, count(*) as 'total' from post
where dateline between (unix_timestamp('2007-04-17'), unix_timestamp('2007-06-18'))
group by userid order by total desc limit 10;
[/sql]


Dismounted 07-01-2007 07:17 AM

[sql]SELECT `userid`, COUNT(*) AS 'total'
FROM `post`
WHERE `dateline` BETWEEN UNIX_TIMESTAMP('2007-04-17 00:00:00')
AND UNIX_TIMESTAMP('2007-06-18 23:59:59')
GROUP BY `userid`
ORDER BY `total` DESC
LIMIT 10[/sql]

Geraldm 07-01-2007 10:13 AM

Doh !!!!!! :rolleyes:
I forget to add the select userid !!!!!!! :)

Thanks everyone for all their help!!

Cheers ...
Gerald.


All times are GMT. The time now is 09:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01005 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete