开发者

pattern matching in DB2 SQl

开发者 https://www.devze.com 2023-03-17 02:40 出处:网络
I have a tab开发者_开发百科le Marks_Table ( MARKS_IDNUMBER, ST_IDNUMBER, MARK_DESCVARCHAR(20), MARKSNUMBER

I have a tab开发者_开发百科le

Marks_Table (
MARKS_ID         NUMBER,
ST_ID            NUMBER,
MARK_DESC        VARCHAR(20),
MARKS            NUMBER
)

Now, MARK_DESC, contains the desciption of the Marks. Now i want to have the rows in the table which contains test in the description.

Now the problem is, that the description may contains test in any pattern, it may be Test, test, TeSt, tEST and so on..

How to fetch the rows with the above conditions.?

Thanks..


what about the "UPPER" function?

select * from marks_table where upper(mark_desc) like '%TEST%'


Marks_Table (
MARKS_ID         NUMBER,
ST_ID            NUMBER,
MARK_DESC        VARCHAR(20),
MARKS            NUMBER,
MARK_search      VARCHAR(20),
)

and insert MARK_search as something like normate(MARK_DESC) with removing spaces and uppercase with a (insert/update) trigger and a stored procedure

0

精彩评论

暂无评论...
验证码 换一张
取 消