Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6582297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:15:45+00:00 2026-05-25T16:15:45+00:00

I have the following MySQL query: SELECT (COUNT(id) * 5) AS total FROM content

  • 0

I have the following MySQL query:

SELECT (COUNT(id) * 5) AS total FROM content WHERE author = 'newbtophp'

I also have a column called content_timestamp (which contains the UNIX timestamp of when the content was created).

The MySQL query is functioning fine, however I only want the COUNT(id) to consider a maximum of 3 content per day (so if the table content contains more then 3 rows of data WHERE the day (+ month + year) of the content_timestamp is the same then only consider the first 3 and disregard the rest) – this is where I believe the content_timestamp will become useful.

However I’m unsure on how to do this?

All help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:15:46+00:00Added an answer on May 25, 2026 at 4:15 pm

    Will it work for you?

    Update

    SELECT 5*SUM(IF(num_content>3,3,num_content)) 
    FROM
    (
    SELECT DATE(content_timestamp) as dt, COUNT(id) as num_content
    FROM content     
    WHERE author = 'newbtophp'
    GROUP BY DATE(content_timestamp)
    )a
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query in mysql 5.1.41: select distinct table_schema from information_schema.tables where
I have the following MySQL query and tables from which I am querying: SELECT
I have the following MySQL query: SELECT p.*, IF(COUNT(ms.PropertyID) > 0,1,0) AS Contacted, pm.MediaID,
I have the following query: SELECT location, step, COUNT(*), AVG(foo), YEAR(start), MONTH(start), DAY(start) FROM
I have the following table: mysql> SELECT * FROM temp; +----+------+ | id |
I have the following MySQL query, and PHP code to format the Count result
I have the following query which works fine with MySQL but refuses to work
I have the following MySQL query, and I'm trying to adjust it so it
I have a MySQL query: SELECT px.player, px.pos, px.year, px.age, px.gp, px.goals, px.assists ,
I have the following table in MySQL (version 5): id int(10) UNSIGNED No auto_increment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.