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 |
collie
Constraint Violating Yak Guru
400 Posts |
Posted - 2006-11-28 : 02:16:15
|
Hi,I have a table called Details in SQL SERVER 2005. The table has a field called Weekdays that stores data in the form saturday,sunday,monday,I want a select query that will return the values but without the last comma so the result must besaturday,sunday,mondayHow can i do that?Thanks |
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-11-28 : 02:21:45
|
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspxChiraghttp://chirikworld.blogspot.com/ |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-28 : 02:27:52
|
SELECT CASE WHEN RIGHT(weekdays, 1) = ',' THEN LEFT(weekdays, len(weekdays) - 1) else weekdays endfrom yourtablePeter LarssonHelsingborg, Sweden |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-28 : 02:40:41
|
Instead of writing query to exclude last comma, while inserting itself take care to insert properly. It will save much of the unnecessary overhead.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
|
|