मुद्दा यह है कि आप किसी ऐसी चीज से ऑर्डर कर रहे हैं जो आपके group by
. में नहीं है खंड।
उदाहरण के लिए, यह काम करता है
SQL> with testGroup as ( select 1 as one, 2 as two from dual)
2 select one
3 from testGroup
4 group by one;
ONE
----------
1
अगर आप order by
एक कॉलम जो आपके group by
. में नहीं है खंड:
SQL> with testGroup as ( select 1 as one, 2 as two from dual)
2 select one
3 from testGroup
4 group by two;
select one
*
ERROR at line 2:
ORA-00979: not a GROUP BY expression
यदि आप group by
संपादित करते हैं order by
. में आवश्यक कॉलम को संभालने के लिए क्लॉज :
SQL> with testGroup as ( select 1 as one, 2 as two from dual)
2 select one
3 from testGroup
4 group by one, two;
ONE
----------
1
SQL>