MySQL Forums
Forum List  »  Quality Assurance

How can I use "IN" option on "Select" statement ?
Posted by: Juan Carlos Alarcon
Date: August 21, 2008 07:38PM

Hello everybody,


I have the next script :
select * from data_n where variatid in (select distinct variatid from variate where traitid = 1008 and scaleid = 1008) and dvalue <= 180

MySql takes a long time ( allways I need to stop the process)
SqlServer only 6 secs.

If I change the script and I put the values into the parenthesis:
select * from data_n where variatid in (value1,value2,..value400) and dvalue <= 180

MySql takes 8 secs.

I have the same indexes and the same number of records in both databases (MySql and SQL Server)

Somebody can say me what is my problem ? or

Somebody can say me how MySQL works in this situation?

Regards and Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
How can I use "IN" option on "Select" statement ?
2944
August 21, 2008 07:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.