How to solve the query for this sorting - Bandi [Resolved]

Posted by Jayakumars under Sql Server on 5/22/2015 | Points: 10 | Views : 292 | Status : [Member] [MVP] | Replies : 1
Hi
Bandi

I need ascending order data following requirements


create table #temp1(Name varchar(20))
insert into #temp1 (Name)
select 'ZenCar1523'
union all
select 'Apple0-300'
union all
select 'Fox110-150'
union all
select 'Hen61-230'
union all
select 'Yamaha41-71'
union all
select 'Rx81-100'


Select * from #temp1

--I need output this
--=====================
Apple0-300
Fox110-150
Hen61-230
Rx81-100
Yamaha41-71
ZenCar1523

Mark as Answer if its helpful to you


Responses

Posted by: Sriharim on: 5/23/2015 [Member] Starter | Points: 50

Up
0
Down

Resolved
create table #temp1(Name varchar(20))
insert into #temp1 (Name)
select 'ZenCar1523' union all
select 'Apple0-300' union all
select 'Fox110-150' union all
select 'Hen61-230' union all
select 'Yamaha41-71' union all
select 'Rx81-100'

Select * from #temp1 order by name asc


output is:

Apple0-300
Fox110-150
Hen61-230
Rx81-100
Yamaha41-71
ZenCar1523

---
Srihari

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response