Query to get specific word in a column
-
Hi, I am need of a query to retrieve a column by trimming in a particular format. For example I have a field called UserName. The data is as follows UserName -------- user1 (user1@noreply.com) user2 (user2@noreply.com) user3 (user3@noreply.com) Here I want a query to retrieve username data as user1 user2 user3 I have to trim the content from '(' to ')' Please Let me know the query. Thanks in Advance, Jaya
-
Hi, I am need of a query to retrieve a column by trimming in a particular format. For example I have a field called UserName. The data is as follows UserName -------- user1 (user1@noreply.com) user2 (user2@noreply.com) user3 (user3@noreply.com) Here I want a query to retrieve username data as user1 user2 user3 I have to trim the content from '(' to ')' Please Let me know the query. Thanks in Advance, Jaya
-
select substring(UserName,charindex('(',UserName), charindex(')',UserName)-charindex('(',UserName)) from UserTable is the sybase syntax. The SQL Server syntax should be equivalent. Please check.
-
Hi, I am need of a query to retrieve a column by trimming in a particular format. For example I have a field called UserName. The data is as follows UserName -------- user1 (user1@noreply.com) user2 (user2@noreply.com) user3 (user3@noreply.com) Here I want a query to retrieve username data as user1 user2 user3 I have to trim the content from '(' to ')' Please Let me know the query. Thanks in Advance, Jaya