-1

I have a table which looks like this:

**Description**
North
East
West
South

Now if I want to search the table in the column description using a subscript of a string like for example I want to search the value North but the available string I have is "ValueNorth"

its like this sample SQL:

SELECT Description FROM Table1 WHERE Description = 'ValueNorth'

Now what I want to display in the result is the value of North in the description.

Is it possible in SQL server.

Thanks for the help

Jithin Shaji
  • 5,893
  • 5
  • 25
  • 47
zyberjock
  • 337
  • 5
  • 19

3 Answers3

0

Um it's very hard to understand what you are asking but is this what you are looking for?

SQL> SELECT SUBSTRING('Quadratically',5,6);
+---------------------------------------------------------+
| SUBSTRING('Quadratically',5,6)                          |
+---------------------------------------------------------+
| ratica                                                  |
+---------------------------------------------------------+
1 row in set (0.00 sec)

as you can see it cuts up the string, more examples here: http://www.tutorialspoint.com/sql/sql-string-functions.htm#function_substring-index

Le Green
  • 110
  • 5
0

You can compare the value percentage matching between two values and then get the results based on the condition.

This may help you.

T-SQL Get percentage of character match of 2 strings

Community
  • 1
  • 1
Roshan Nuvvula
  • 803
  • 1
  • 8
  • 28
0

try this:

SELECT replace (Description,'Value','') FROM Table1 WHERE Description = 'ValueNorth'