Click here to Skip to main content
15,914,406 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello.

i am using SQlserver 2008r2 , i have table known as :

City(CityId , CityName)

i have also inserted some cites in CityName field but some others has been
mised , and i need to insert themm not in the final row ,but ofcourse i want
to insert them among the previous CityName rows according to their alphabet
sort , how can i do that?
Posted

1 solution

That's not how SQL works ...

how do i add order by to my insert statement[^]
 
Share this answer
 
Comments
Sandeep Mewara 17-Jun-12 8:06am    
5!
mohammad ehsan 18-Jun-12 3:49am    
but i didn't mean what you introduce in the link(it is for data bind to sql)

what i need is a query in sql to provide a solution to insert a row betweeen
another rows according to alphabet sort.
barneyman 18-Jun-12 3:55am    
have a look at ORDER BY

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900