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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:53:13+00:00 2026-05-23T16:53:13+00:00

So im creating a integration script, but for some reason its not showing the

  • 0

So im creating a integration script, but for some reason its not showing the exprected result.
My query is

SELECT xf_user_group_relation.user_id, xf_user_group_relation.user_group_id, MAX( xf_user_group.display_style_priority ) AS display_style_priority
FROM xf_user_group_relation
INNER JOIN xf_user_group ON xf_user_group_relation.user_group_id = xf_user_group.user_group_id
WHERE xf_user_group.display_style_priority >=1000
GROUP BY user_id

One of the lines in the result which is unexpected is this

user_id | user_group_id | display_style_priority    
86 | 11 |5200

The group with the id 11 has display_style_priority 2000 and not 5200. It should show the user group id with display_style_priority 5200.
Which is the highest ranked group this user is in.
Can somebody point out what im doing wrong.

  • 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-05-23T16:53:14+00:00Added an answer on May 23, 2026 at 4:53 pm

    Try changing the GROUP BY to

    GROUP BY
       xf_user_group_relation.user_id, xf_user_group_relation.user_group_id
    

    Most other DBMS would throw an error for that query because every column in the SELECT list must be either aggregated or in the GROUP BY.

    Edit: this is a great example of why ANSI-SQL and other RDBMS do not allow this syntax

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

Sidebar

Related Questions

I'm creating a website with OpenID auth but I'm not sure what fields should
Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select
As shown in a domain-manager article , I am interested in creating an integration
Creating simple php login scripts is easy, with simple one table mysql integration. I
Wondering if someone could help with with some Spring.net IOC integration into a .aspx
I am creating an app for Facebook and twitter integration using sharekit. That works
I use Jenkins to run some integration tests on a web appilcation (using cucumber,
We're creating a Interaction design pattern website for a class. We've been using google
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups.
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=

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.