Note that there are some explanatory texts on larger screens.

plurals
  1. POOracle group by too long time
    primarykey
    data
    text
    <p>I have this Query:</p> <pre><code> SELECT B.BILL_BALANCE, B.PRIME_UID, home.IDENT, PRESENT.ACC_LOGIN, PRESENT.ACCOUNT_NAME2, eq .ACCESS_NO AS PHONE, adres.DISP_STREET_NAME, B.BILL_DT FROM addresses adres , BILL_HISTORY B LEFT JOIN eq eq ON eq.ACCOUNT_NO = B.ACCOUNT_NO JOIN sec PRESENT ON B.ACCOUNT_NO = PRESENT.ACCOUNT_NO JOIN sec_text home ON home.ACCOUNT_NO = B.ACCOUNT_NO WHERE eq.STATUS_CD = 'CU' AND (B.BILL_TP_CD='CB' OR B.BILL_TP_CD='FB') AND (PRESENT.bill_addr_UID=adres.PRIME_UID OR PRESENT.COMPANY_REG_ADDR_UID=adres.PRIME_UID) AND B.BILL_PAID_DT IS NULL AND B.BILL_DT &gt;= to_date('2011-07-01') AND B.BILL_DT &lt;= to_date('2011-07-02') AND rownum &lt;=1000 GROUP BY B.PRIME_UID, B.BILL_BALANCE, home.IDENT, PRESENT.ACC_LOGIN, PRESENT.ACCOUNT_NAME2, eq .ACCESS_NO, adres.DISP_STREET_NAME, B.BILL_DT </code></pre> <p>I need to "group by" by B.PRIME_UID, after ths I had this error:</p> <blockquote> <pre><code> [code] =&gt; 979 [message] =&gt; ORA-00979: not a GROUP BY expression [offset] =&gt; 8 </code></pre> </blockquote> <p>I added all columns to "group by" and it works. </p> <p>This query works with "rownum" only.When I'm trying to remove "rownum" - Approaching data is too long..more than 50 minutes..</p> <p>How can I rewrite sql without using rowcount?<br> Thanks.</p> <p>Approximation data in table is more than 100 000.<br></p> <p>UPDATED*<br> "Explain PLAN FOR" didn't work.</p> <pre><code>Array ( [error] =&gt; 1 [error text] =&gt; not found [sql] =&gt; EXPLAIN PLAN FOR SELECT B.BILL_BALANCE,B.PRIME_UID,home.IDENT,PRESENT.ACC_LOGIN,PRESENT.ACCOUNT_NAME2,eq .ACCESS_NO as PHONE,adres.DISP_STREET_NAME,B.BILL_DT FROM addresses adres ,BILL_HISTORY B LEFT JOIN eq eq ON eq.ACCOUNT_NO = B.ACCOUNT_NO JOIN sec PRESENT ON B.ACCOUNT_NO = PRESENT.ACCOUNT_NO JOIN sec_text home ON home.ACCOUNT_NO = B.ACCOUNT_NO WHERE eq.STATUS_CD = 'CU' AND (B.BILL_TP_CD='CB' OR B.BILL_TP_CD='FB') AND (PRESENT.bill_addr_UID=adres.PRIME_UID OR PRESENT.COMPANY_REG_ADDR_UID=adres.PRIME_UID) AND B.BILL_PAID_DT IS NULL AND B.BILL_DT &gt;= to_date('2011-07-01') AND B.BILL_DT &lt;= to_date('2011-07-02') AND rownum &lt;=10 GROUP BY B.PRIME_UID,B.BILL_BALANCE,home.IDENT,PRESENT.ACC_LOGIN,PRESENT.ACCOUNT_NAME2,eq .ACCESS_NO,adres.DISP_STREET_NAME,B.BILL_DT ) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload