Skip to main content
deleted 24 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Will somebody optimize this sql query Get distinct of two columns

I want to get distinctdistinct of two columns from an sqlSQL table. I am getting this result can i Can I optimize this query.?

create TABLE #Temporary_tbl
(                              
    ProductColour VARCHAR(50),
    ProductSize VARCHAR(20),
)

insert into #Temporary_tbl (ProductColour)
select distinct productcolour
from shoptransfer

insert into #Temporary_tbl (ProductSize)
select distinct ProductSize
from shoptransfer

select * from #Temporary_tbl

Will somebody optimize this sql query

I want to get distinct of two columns from an sql table. I am getting this result can i optimize this query.

create TABLE #Temporary_tbl
(                              
    ProductColour VARCHAR(50),
    ProductSize VARCHAR(20),
)

insert into #Temporary_tbl (ProductColour)
select distinct productcolour
from shoptransfer

insert into #Temporary_tbl (ProductSize)
select distinct ProductSize
from shoptransfer

select * from #Temporary_tbl

Get distinct of two columns

I want to get distinct of two columns from an SQL table. Can I optimize this query?

create TABLE #Temporary_tbl
(                              
    ProductColour VARCHAR(50),
    ProductSize VARCHAR(20),
)

insert into #Temporary_tbl (ProductColour)
select distinct productcolour
from shoptransfer

insert into #Temporary_tbl (ProductSize)
select distinct ProductSize
from shoptransfer

select * from #Temporary_tbl
Tweeted twitter.com/#!/StackCodeReview/status/56008231641812992
edited tags
Link
Brian Reichle
  • 2k
  • 1
  • 19
  • 26

I want to get distinct of two columns from an sql table. I am getting this result can i optimize this query.

create TABLE #Temporary_tbl (
ProductColour VARCHAR(50), ProductSize VARCHAR(20),

create TABLE #Temporary_tbl
(                              
    ProductColour VARCHAR(50),
    ProductSize VARCHAR(20),
) 

insert into #Temporary_tbl (ProductColour )  
select distinct productcolour
from shoptransfer

insert into #Temporary_tbl (ProductSize )  
select distinct ProductSize
from shoptransfer 

select * from #Temporary_tbl

I want to get distinct of two columns from an sql table. I am getting this result can i optimize this query.

create TABLE #Temporary_tbl (
ProductColour VARCHAR(50), ProductSize VARCHAR(20),

                    )
insert into #Temporary_tbl (ProductColour ) select distinct productcolour
from shoptransfer

insert into #Temporary_tbl (ProductSize ) select distinct ProductSize
from shoptransfer
select * from #Temporary_tbl

I want to get distinct of two columns from an sql table. I am getting this result can i optimize this query.

create TABLE #Temporary_tbl
(                              
    ProductColour VARCHAR(50),
    ProductSize VARCHAR(20),
) 

insert into #Temporary_tbl (ProductColour) 
select distinct productcolour
from shoptransfer

insert into #Temporary_tbl (ProductSize) 
select distinct ProductSize
from shoptransfer 

select * from #Temporary_tbl
Source Link
Zain
  • 184
  • 8
Loading