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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:01:58+00:00 2026-06-08T07:01:58+00:00

How to select user_ids by B meta_key and order by ratings meta_value? user_id |

  • 0

How to select user_ids by B meta_key and order by ratings meta_value?

    user_id    |    meta_key    |    meta_value
-----------------------------------------------------
       1                A                1
       1                B                1
       1                C                1
       1              rating             9
       8                A                1
       8                C                1
       8              rating           99999
       7                A                1
       7                B                1
       7                C                1
       7              rating            999

I need to get an IDs of users who have B meta_key and, then, to order IDs by user rating values.

  • 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-08T07:01:59+00:00Added an answer on June 8, 2026 at 7:01 am

    Try this:

    SELECT T1.user_id
        FROM yourtable T1 
        JOIN yourtable T2
            ON T1.user_id = T2.user_id
            AND T2.meta_key = 'rating'
        WHERE T1.meta_key = 'B'
        ORDER BY CAST(T2.meta_value AS SIGNED)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have the following: $query = SELECT user_id,email,password, roles.role_id,role_name FROM users JOIN roles
The first select is select user_id, count(*) as count from users where referrer IS
Ok, so basically I need to select multiple IDs from one column, then use
I'm trying to select dynamic ids when a user types something into the input
currently I am using: $result = new SQLite3(sprintf(users/USERIDS_DB.sqlite)); $numRows = $result->exec (SELECT count(*) FROM
SELECT user_id, created FROM photo_comments GROUP BY user_id returns user_id created 1 2009-10-20 21:08:22
cursor.execute(SELECT user_id FROM myapp_location WHERE\ GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < %s\ ,(user_utm_easting, user_utm_northing, 500)); This
I have a query like this SELECT user_id FROM user WHERE user_id NOT IN
That's just my php snippet: $cookies=$_COOKIE['rwt']; $user =mysql_query(SELECT user FROM users WHERE cookies='$cookies'); How
I have a users table, and a view table which lists some user ids...

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.