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

Problem with variable declaration in switch statement
Hello, I am having some trouble assigning a value to a variable inside a switch statement. What I a

Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,

Im relativity new to PHP and MySQL and i have come up against a problem. i h

How to use Substr
I want to check for the word CATEGORY: inside a string which can be CATEGORY: ITEM
and remove the

Month String to Numeric?
Hi guys,

Given a month as a string, is there a simple way to find the numeric representation

email form (cannot find the problem)
Hello there. I've been having trouble with an email form. Can't find the problem really. I've tested

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

mySQL and PHP search
Hello,
I am trying to code a project and ran into a brick wall with one of my pages. I am pretty

how to load a Sys file with system load and call images?
normally you need register the module as a service with CreateService, and start the service

URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

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