如何选择单词末尾具有特定值的单词

如何选择单词末尾具有特定值的单词

本文介绍了SQL-如何选择单词末尾具有特定值的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是sql的新手,我想知道如何在名为Name的列中的值末尾找到字母或符号?例如,如果我发现我会写select * from 'table' where 'Name' like '%es%'的东西,但它将发现我所有包含es
的行可以说-lesl, pespe, mess ...但是如何编写select来选择单词末尾的'es'值呢? ...使用regex,我将使用es\Z .....,谢谢!!

iam new to sql and i would like to know how can I find the letter or symbol at the end of value in column called Name?E.g if i would find something i will write select * from 'table' where 'Name' like '%es%' but it will find me all rows contains es
Lets say - lesl, pespe, mess... but how to write select which will select just values with 'es' At the end of word? ... using regex i will use es\Z..... thanks in advance!

推荐答案

您必须删除最后一个%,因此它只会选择带有es end 单词.

You have to remove the last %, so it will only select words ending with es.

select * from table where Name like '%es'

这篇关于SQL-如何选择单词末尾具有特定值的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 12:29