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

  • SEARCH
  • Home
  • 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 8195235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:04:05+00:00 2026-06-07T05:04:05+00:00

My query of interest is below SELECT COUNT(a.id) FROM users AS a RIGHT JOIN

  • 0

My query of interest is below

    SELECT COUNT(a.id) 
      FROM users AS a 
RIGHT JOIN date_log AS b 
        ON a.id = b.user_id 
     WHERE
           b.meeting_date BETWEEN '2012-06-01' 
                      AND DATE_ADD('2012-06-01', INTERVAL 1 MONTH) 
  GROUP BY a.id

However, it’s too slow when I try to select data from a large database.
I added ‘group by’ terms in the query for removing duplicated ids.

Is there better way to do this job?

  • 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-06-07T05:04:07+00:00Added an answer on June 7, 2026 at 5:04 am

    If you just need the count, you can make this query a left-join, and see if MySQL has a better time executing it (I’m not sure how it actually performs RIGHT JOINs, but I can imagine it in ways which are inefficient compared to LEFTs…

    SELECT users.id, count(users.id) as user_count
    FROM 
      date_log
      LEFT JOIN users ON date_log.user_id = users.id
    WHERE
      date_log.meeting_date BETWEEN '2012-06-01' AND DATE_ADD('2012-06-01', INTERVAL 1 MONTH)
    GROUP BY users.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Query: SELECT u.user_id,r.totalVotes votes,r.totalPoints rating,@row:=@row+1 rank FROM mismatch_user u LEFT JOIN ratingItems r ON
Below query expression: SELECT distinct xmlCol.value('(//interest/@id)[1]','nvarchar(64)') FROM table1 Returns a list of id of
Query: SELECT DISTINCT ([Equipment List].ID) AS Expr1, [Job Assignments].Job FROM [Equipment List] LEFT JOIN
I have a query as follows; SELECT COUNT(Id) FROM Table The table contains 33
is there a way to do the following in one Django query? MyModel.filter(attr=a).values('attr','fields','of','interest').annotate(count=Count('id')) MyModel.filter(attr=b).values('attr','fields','of','interest').annotate(count=Count('id'))
Query 1: SELECT * FROM user_d1 WHERE EXISTS (SELECT 1 FROM `user_d1` WHERE birthdate
I have an application where users can select a variety of interests from around
So first I do this: $zip_code_array = mysql_query(SELECT * FROM zip_code WHERE (lon BETWEEN
In the data below I am looking for a query so I can join
This query works: select p.Nombre as Nombre, c.Nombre as Categoria, s.Nombre as Subcategoria FROM

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.