var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Problem with a select distinct
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
Why do you select "a, b, c, d, e, f" from a table if you need only distinct "a, b, c, d"? In other words, why not directly
select distinct a, b, c, d