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.
| Author |
Topic |
|
pnunes1
Starting Member
2 Posts |
Posted - 2006-01-06 : 12:09:54
|
| I have string fields witch is people names.I want to order by last name (surname).The question is that I only have one field with full names. How can I order a query by last name ?Example:Pedro Alexandre NunesJoão AntunesAntónio Camargo SetubalDesired order:Antunes, JoãoNunes, Pedro AlexandreSetubal, António CamargoThanks. |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-01-06 : 12:35:02
|
| order by right(name, charindex(' ', reverse(name))==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
pnunes1
Starting Member
2 Posts |
Posted - 2006-01-07 : 05:50:41
|
| Solved.Thank you. |
 |
|
|
|
|
|