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 ...)

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

Taylor Series Function
So I am working a a project for my intro C++ class, and I am having some trouble with a function for

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

UDP Multicast question
Hey,

Im not really in the know when it comes to network related programming and activitie

Hotlinking Picasa as the image folder of a website
Hi there PHP freaks, I would like to create a private album in Picasa to use it as the image folder

Ten Operator Syntax
Hi Guys,

I can't figure out why i am getting a parse error with this basic ten op code:

Echo multiple lines of html code
Hi guys,

I would like to know if there is a way to echo multiple lines of html codes.

Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe

JQuery, Masterpage, and Control issue
Hey everyone, I am using JQuery in several sites so I thought it would be best to place the library

disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

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