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 7780415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:53:26+00:00 2026-06-01T18:53:26+00:00

Consider the following table (tweets): +———+————+———-+ | user_id | _date | tweet_id | +———+————+———-+

  • 0

Consider the following table (“tweets”):

+---------+------------+----------+
| user_id | _date      | tweet_id |
+---------+------------+----------+
| 1       | 2011-03-17 | 12       |
| 1       | 2011-03-17 | 16       |
| 1       | 2011-01-18 | 17       |
| 2       | 2011-03-18 | 23       |
| 2       | 2011-01-17 | 29       |
| 2       | 2011-03-17 | 32       |
| 2       | 2011-01-17 | 33       |
| 2       | 2011-03-18 | 34       |
| 2       | 2011-01-19 | 45       |
| 2       | 2011-03-19 | 48       |
| 3       | 2011-01-19 | 50       |
| 3       | 2011-03-19 | 51       |
| 3       | 2011-01-19 | 52       |
| 3       | 2011-01-20 | 53       |
+---------+------------+----------+

I want the following output: tweets PER user ORDERED BY date:

user_id  _date       cnt
------------------------
1        2011-03-17  2
1        2011-03-18  1
2        2011-03-17  3
2        2011-03-18  2
2        2011-03-19  2
3        2011-03-19  3
3        2011-03-20  1

I don’t understand why, but this doesn’t work:

SELECT user_id, _date, COUNT(tweet_id) AS cnt FROM tweets 
GROUP BY nyse_date ORDER BY sp100_id ASC

Could someone explain to me why?

  • 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-01T18:53:27+00:00Added an answer on June 1, 2026 at 6:53 pm

    You almost got it. Not sure why you have nyse_date and sp100_id in there? You need to group together user_id and _date, and order by them. This should do it for you:

    SELECT user_id, _date, COUNT(tweet_id) AS cnt FROM tweets 
    GROUP BY user_id, _date ORDER BY user_id, _date ASC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following tweets table tweet_id user_id text ----------------------------------------- 1 1 look at my
Please consider the following tweets table: tweet_id user_id text ---------------------------- 1 1 lorem ipsum
Consider the following table views user_id _date cnt ------------------------ 1 2011-02-10 123 1 2011-02-11
Consider the following table tweets tweet_id call_id id_str timestamp text -------------------------------------------------- 1 11 12345
Consider the following tables: users and tweets user_id name tweet_id user_id tweet spam -----------------
Consider the following table of tweets id tweet ------------------------------------------------------ 1 alcoa inc stock analysis
Consider the following table named Persons : Key Name Type Date Pack 1 Pocoyo
Please consider the following table 'mmm': select * from mmm; Output: +-------+-------+------+ | texto
Consider the following table: mysql> select * from phone_numbers; +-------------+------+-----------+ | number | type
Consider the following table: create table temp ( name int, a int, b int

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.