Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
can i use OR with left and charindex together..some thing like this
select (left(product,charindex('_',product))) OR (left(product,charindex(' ',product))) AS 'Product'
thanks
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2008-09-19 : 05:38:02
Your code does not make sense.
case when charindex('_', product) <> 0 then left(product, charindex('_', product)) when charindex(' ', product) <> 0 then left(product, charindex(' ', product)) else product end
KH[spoiler]Time is always against us[/spoiler]
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2008-09-19 : 05:41:19
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=110967MadhivananFailing to plan is Planning to fail
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2008-09-19 : 05:51:12
faster by 1+ minKH[spoiler]Time is always against us[/spoiler]