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 |
|
trouble2
Constraint Violating Yak Guru
267 Posts |
Posted - 2007-08-09 : 05:06:03
|
| Hi, I have this SP which simply returns all records, sorted by a name field, so it returns something like:fred www.somewebsite.comhenry NULLpeter www.anotherwebsite.netsamuel NULLWhat I would like to do, is to return the names with a website first, sorted by name, and then return the names without a website, sorted by name. So it should return this:fred www.somewebsite.competer www.anotherwebites.comhenry NULLsamuel NULL |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-08-09 : 05:09:51
|
| order bycase when name like '% www.%' then 1 else 2 end ,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. |
 |
|
|
trouble2
Constraint Violating Yak Guru
267 Posts |
Posted - 2007-08-09 : 05:17:37
|
| Very nice... |
 |
|
|
|
|
|