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
 General SQL Server Forums
 New to SQL Server Programming
 string query

Author  Topic 

sqlhelp14
Yak Posting Veteran

55 Posts

Posted - 2008-04-11 : 14:17:16
usa,united states - united states
usa,spain - spain
usa,france - france

how to get that?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-11 : 14:24:24
SELECT 'usa,united states - united states' union all
select 'usa,spain - spain' union all
select 'usa,france - france'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-11 : 15:02:48
SELECT PARSENAME(REPLACE(column,',','.'),1) FROM YourTable

OR
SELECT PARSENAME(REPLACE(yourstringvalue,',','.'),1) if you're directly passing string
Go to Top of Page

sqlhelp14
Yak Posting Veteran

55 Posts

Posted - 2008-04-11 : 15:46:03
thanks both of you.
peso and visakh16.

i got correct results.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-14 : 03:14:19
quote:
Originally posted by sqlhelp14

thanks both of you.
peso and visakh16.

i got correct results.


You cant get the same result from the above replies

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -