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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:17:16+00:00 2026-06-15T21:17:16+00:00

I have 2 tables: articles: id title text timestamp articles_views: id article_id timestamp I

  • 0

I have 2 tables:

articles:
id
title
text
timestamp

articles_views:
id
article_id
timestamp

I need sql query which would return list of all articles ordered by articles_views count for that article.

  • 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-15T21:17:17+00:00Added an answer on June 15, 2026 at 9:17 pm
    SELECT
        a.id
        , a.Title
        , COUNT(v.id)
    FROM
        articles a
    LEFT JOIN
        article_views v
    ON a.id = v.article_id
    GROUP BY
        a.id, a.title
    ORDER BY
        COUNT(v.id) DESC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have these tables: table_a user_id article_id created_at articles user_id created_at ... I need
Suppose I have the following tables: Articles with fields article_id , title Tags with
I have three tables: articles(id int) tags(id int, name varchar(255)) articles_tags(article_id, tag_id) I want
I have a table articles that has a column company which has list of
I have a two tables as authors and articles. I want to get list
I have a table articles with columns and data: article_id title body 1 This
I have 2 tables: CREATE TABLE article ( id serial NOT NULL, title text,
I have two innodb tables: articles id | title | sum_votes ------------------------------ 1 |
I have 3 tables: articles (id, title, content), tags (id, tag) and tags2all (id,
I have two tables, like this: #Articles: ID | Title 1 Article title 2

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.