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)
 Create a column order

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-09 : 08:07:19
QuyenLam writes "Hi all,

How to create a column order in the select statement follow the condition ?
Ex: Select Name From Test Where Name like'%N'
1 Nam
2 Na
3 Ninh
.....

Thanks"

MakeYourDaddyProud

184 Posts

Posted - 2002-07-09 : 08:33:43
select * from Test Where Name like'%N' order by Name might work


Daniel Small MIAP
www.danielsmall.com IT Factoring
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-09 : 09:37:59
QuyenLam, I'm not quite sure what you are looking for and what you are asking. In your example, the name data is not in any particular order (as Nam should come after Na alphabetically). Additionally, what are the numbers and where did they come from?

Also, like '%N' shouldn't return any of this data as none of these names end in 'n'....

<O>
Go to Top of Page
   

- Advertisement -