Jump to content

ERROR 1104: comes while executing the query


sukhpreet_ahluwalia

Recommended Posts

i got this error:

ERROR 1104: The SELECT would examine too many records and probably take a very long time. Check your WHERE and use SET OPTION SQL_BIG_SELECTS=1 if the SELECT is ok.

 

I used set sql_big_select= 1; statement before the query. But still the problem

is continuing.

 

 

Query is such that there are four tables feeder,sentout,ht and lt... now in feeder and sentout the fields feeder_code and subdivision_code combination row is unique...But in the ht and lt tables the feeder and can have combination with different subdivisions which is now not fixed..Now i want resultset and feeder_code and subdivision.. having all the combination in the four tables...

 

Query is as below

----------------

SELECT distinct f.feeder_code ,f.subdivision_code from feeder as f,sentout as sot,ht,lt where

(f.feeder_code = lt.feeder_code and f.subdivision_code = lt.subdivision_code and

lt.month = 4 and lt.year =  or (f.feeder_code = ht.feeder_code and f.subdivision_code = ht.subdivision_code

and ht.month = 3 and ht.year =  or (f.feeder_code = sot.feeder_code and

f.subdivision_code = sot.subdivision_code and sot.month = 3 and sot.year =

UNION

(SELECT distinct lt.feeder_code ,lt.subdivision_code from feeder as f,lt where lt.feeder_code != f.feeder_code

and lt.subdivision_code != f.subdivision_code and

lt.month = 4 and lt.year =

UNION

(SELECT distinct ht.feeder_code ,ht.subdivision_code from feeder as f,ht where ht.feeder_code != f.feeder_code and ht.subdivision_code != f.subdivision_code and

ht.month = 3 and ht.year = 8 )

order by feeder_code,subdivision_code

 

 

 

Plz help me as soon as possible. I have to solve the issue at earliest.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.