t******t 发帖数: 51 | 1 How to check string A is a substring of string B in SQL? Specifiaclly, how to
finish the following SQL query:
select ...
from tableA x
where x.attributeA is a substing of stringB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks in advance! |
p*******k 发帖数: 57 | 2 it depends on which Database server you are using.
you may find some string related function
look for examples or google.
for example:
USE Northwind
GO
SELECT ProductName
FROM Products
WHERE CONTAINS(ProductName, ' "sasquatch ale" OR "steeleye stout" ')
GO
to
【在 t******t 的大作中提到】 : How to check string A is a substring of string B in SQL? Specifiaclly, how to : finish the following SQL query: : select ... : from tableA x : where x.attributeA is a substing of stringB : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : Thanks in advance!
|
t******t 发帖数: 51 | 3 I'm using Oracle 9.
【在 p*******k 的大作中提到】 : it depends on which Database server you are using. : you may find some string related function : look for examples or google. : for example: : USE Northwind : GO : SELECT ProductName : FROM Products : WHERE CONTAINS(ProductName, ' "sasquatch ale" OR "steeleye stout" ') : GO
|
l****g 发帖数: 122 | 4 look up "instr()" function in your oracle manual.
Thanks.
to
【在 t******t 的大作中提到】 : How to check string A is a substring of string B in SQL? Specifiaclly, how to : finish the following SQL query: : select ... : from tableA x : where x.attributeA is a substing of stringB : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : Thanks in advance!
|
t******t 发帖数: 51 | 5
Problem solved! instr() is the way to go. Thank you.
【在 l****g 的大作中提到】 : look up "instr()" function in your oracle manual. : Thanks. : : to
|