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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:57:05+00:00 2026-06-05T00:57:05+00:00

Here is my like table with 6 tabs (don’t if tab is the right

  • 0

Here is my like table with 6 tabs (don’t if tab is the right name) I have a good request to select topics with the more likes, recents, and in a specific forum.

http://trotirider.com/stak1.jpg

SELECT tid, Sum(value) AS value_total
FROM punlike
WHERE value = 1
  AND (fid = 31 OR fid = 33)
GROUP BY tid
ORDER BY value_total DESC, tid DESC

http://trotirider.com/stak2.jpg

But I only need ‘tid’, value_total is just here to order by. How to get only one tab with this request ? Is it possible to make it with a sql request or do I must make it in php with a loop or other ?

Thanks.

  • 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-05T00:57:07+00:00Added an answer on June 5, 2026 at 12:57 am

    Not sure if this is going to work, but give it a shot:

    SELECT tid
    FROM punlike
    WHERE value = 1
      AND fid IN (31, 33)
    GROUP BY tid
    ORDER BY SUM(value) DESC, tid DESC;
    

    If that doesn’t work, try this:

    SELECT tid
    FROM (SELECT tid, SUM(value) AS value_total
          FROM punlike
          WHERE value = 1
            AND fid IN (31, 33)
          GROUP BY tid
          ORDER BY value_total DESC, tid DESC);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page search in development here on the Table of Contents tab:
Situation is as below. I have a table like here: Col1 Col2 Col3 Col4
I've tried the solution here , but it doesn't work. My table is like
Here's the situation: I would like to iterate through a table with input controls,
Here's what I'd like to do. For each table in linkedserver.database whose tablename is
My html is like this <div id=rsContainer> <table id=rsTable><!-- DATA HERE --></table> </div> and
i have implemented code like here but it's not working for iOS 5.0, it
I have an ajax navigation similar like here . now if a menu is
I have few Vaadin tabs one of them is displaying an table and some
I have string like order by o desc,b asc Here I want to replace

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.