在列值中搜索整个单词
Search a whole word in a column value
我需要编写 T-SQL 查询 returns 记录,其中 Text
列值包含整个单词 he
.
我该怎么做?
SELECT
CreationDate,
Text
FROM Comments
WHERE Text LIKE '%he'
ORDER BY Id DESC
此查询 returns 记录 Text
列值包含 he
作为单词的一部分,例如the distribution
.
这是一个选项:
where ' ' + text + ' ' like '% he %'
这里我根据我对你的要求的了解发送我的查询。
SELECT O.create_date,
O.modify_date,
T.COLUMN_NAME
FROM Information_Schema.COLUMNS T
INNER JOIN sys.objects O
ON O.name = T.TABLE_NAME
AND O.type = 'U'
WHERE T.TABLE_NAME = 'table_name'
AND T.COLUMN_NAME LIKE '%he%'
此致。
我需要编写 T-SQL 查询 returns 记录,其中 Text
列值包含整个单词 he
.
我该怎么做?
SELECT
CreationDate,
Text
FROM Comments
WHERE Text LIKE '%he'
ORDER BY Id DESC
此查询 returns 记录 Text
列值包含 he
作为单词的一部分,例如the distribution
.
这是一个选项:
where ' ' + text + ' ' like '% he %'
这里我根据我对你的要求的了解发送我的查询。
SELECT O.create_date,
O.modify_date,
T.COLUMN_NAME
FROM Information_Schema.COLUMNS T
INNER JOIN sys.objects O
ON O.name = T.TABLE_NAME
AND O.type = 'U'
WHERE T.TABLE_NAME = 'table_name'
AND T.COLUMN_NAME LIKE '%he%'
此致。