SQL Query not showing expected result

后端 未结 1 432
庸人自扰
庸人自扰 2020-12-04 03:48

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_gro         


        
相关标签:
1条回答
  • 2020-12-04 04:35

    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 讨论(0)
提交回复
热议问题