开发者

pattern matching in DB2 SQl

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜