mytable
Cat1
Cat2
Cat3
Start price
End price
A
a
a
12
21
A
a
b
98
11
A
a
a
99
12
A
b
b
12
11
A
b
a
9
0
A
b
b
1
1
…
…
…
…
…
…
…
…
…
…
My result should be like this …..
( Result of SQL Query? )
Cat1
Cat2
Cat3
A
a
a
A
a
b
A
b
a
A
b
b
…
…
…
…
…
…
What is the sql command to do like this?
Maybe this will work for you?
create
table #test( cat1varchar(10),cat2
varchar(10),cat3
varchar(10),StartPrice
int,EndPrice
int)insert
into #testvalues
('A','a','a', 12,21)insert
into #testvalues
('A','a','b', 98,11)insert
into #testvalues
('A','a','a', 99,12)insert
into #testvalues
('A','b','b', 12,11)insert
into #testvalues
('A','b','a', 9,0)select
*from #testSelect
Distinct cat1,cat2,cat3from #testdrop
table #test|||You already have the answer... DISTINCT
Try:
|||SELECT DISTINCT Cat1, Cat2, Cat3 FROM mytable
cloris:
You already have the answer... DISTINCT
Try:
SELECT DISTINCT Cat1, Cat2, Cat3 FROM mytable
Haha ha,, i am foolish ........
Thanks cloris
|||It's one of those things. The languages typically have an easy way of doing something if you know where to look. Good Luck.
No comments:
Post a Comment