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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:05:26+00:00 2026-06-13T10:05:26+00:00

I am currently running this query: SELECT t.videolink, t.userid, t.tag FROM (SELECT * FROM

  • 0

I am currently running this query:

SELECT t.videolink, t.userid, t.tag
    FROM (SELECT * FROM tagstrend ORDER BY timestamp DESC) AS t
        WHERE t.timestamp > ?
        GROUP BY t.tag
        ORDER BY SUM(t.tagcount) DESC
        LIMIT ?, 20;

What I am doing is reversing the order of the table that I am selecting from before I run the rest of the query because when the I use “GROUP BY” I need that to take the top result which is the most recent row in the database.

However doing this will take a hit on the performance/speed of the query because it needs to reverse the order of the table before it can query it.

My question is, is there a way to set the default order of the table to be reversed? Because I will always be SELECTing from this table in reverse order.

Unless someone knows a way of grouping by the most recent row in the database?

  • 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-13T10:05:27+00:00Added an answer on June 13, 2026 at 10:05 am

    “However doing this will take a hit on the performance/speed of the query because it needs to reverse the order of the table before it can query it.”

    I don’t think that is true. Order By …. ASC and Order By …. DESC should have the same performance. Test it and see.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently running a query like this: SELECT * FROM email WHERE email_address LIKE
Evening, I'm currently running this query: SELECT `id`, `type`, `controller` FROM `urls` WHERE `url`
Currently I'm running a MySQL query like this $query = SELECT t1.id AS 'post_id',
I am running this query SELECT sh.*, u.initials AS initals FROM database1.table1 AS sh
Currently I am running something similar to this command: Person.sum(:cholesterol, :group => :age) which
Currently I'm running a query like this to add fields from one table into
Okay so, I'm currently running this code to move a bunch of data from
I have a complex select query and a huge table. I'm running this select
I am currently running a CTE query to recursively build an employee hierarchy from
I currently have this query running on my website, public function searchCandidates($type=null, $gender=null, $age=null)

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.