Problem with a select distinct


Posted on 16th Feb 2014 07:03 pm by admin

I have a problema with a select distinct, I have the next sql:

select distinct a,b,c,d from (select a,b,c,d,e,f...from table where ...)

Did you know?Explore Trending and Topic pages for more stories like this.
The subselect have 25000 rows, it last about 10 seconds, but the select distinct over the subselect takes a long time..., I have waited for 20 minutes, and finally canceled the sql.

When I make this alternative path:

create table2 as (select a,b,c,d,e,f...from table where ...)
select distinct a,b,c,d from table2

The distinct finish in 5 seconds.

I don't understand the differences.... I can't do the alternative path, I need the first sql to work.
I don''t know where is the problem

Any advice will be greatly appreciatted
No comments posted yet

Your Answer:

Login to answer
306 Like 25 Dislike
Previous forums Next forums
Other forums

Multipe Dynamic Controls & AutoPostback Issue
I currently have a need to create many dynamic controls (Example Textboxes) that need to do a PostBa

How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to

I have a parse error in this query help..
Code: $query1="INSERT INTO `rating` (`item_name`, `rating`, `ip_address`, `date_rated`) VALUES

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_
Can anyone view my code and tell me why im getting the error:
Parse error: syntax error, unexpect

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop

problems with php variables in mysql query
i can't seem to get the following query to work.

select $q1c from $vote_rate where id = $re

Help uploading .JPG
I have a problem with upload images when the ending is .JPG capitalized.. I really don't know what c

Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it lo

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash