如何在列中检索包含一部分值的值 [英] how to retrieve the values that contains a part of value in the column

查看:66
本文介绍了如何在列中检索包含一部分值的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一列lastName并且我的数据为

Suppose I have a column lastName and I have the data as

kumar yadav
kumar shah
raghu.
kumar

现在我想编写一个SQL查询以获取其姓氏值

Now I want to write a SQL query that to get the values whose last name contains kumar.

推荐答案

使用 like 运算符

select *
from tablename
where lastname like '%kumar%'

这篇关于如何在列中检索包含一部分值的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆