Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 dynamic sql sorting???

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-11-15 : 07:33:01
darren writes "hi, guys

i have a question on dynamic sql sorting

if i do

select lastName, firstName
from Name
order by lastName, firstName

it's automatically sorted by lastName by ascending order, and firstName by ascending order
if i want to sort lastName by ascending order, and firstName by descending order, what should i do??

select lastName, firstName
from Name
order by lastName asc, firstName dec

the above code gives me a syntax error

thanks for helping me"

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2005-11-15 : 07:56:33

It should be desc not dec
Go to Top of Page
   

- Advertisement -