avatar
t*t
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!
avatar
p*k
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!

avatar
t*t
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

avatar
l*g
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!

avatar
t*t
5

Problem solved! instr() is the way to go. Thank you.

【在 l****g 的大作中提到】
: look up "instr()" function in your oracle manual.
: Thanks.
:
: to

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。