Using wildcard in table data

2019-09-21 12:40发布

Using MYSQL I have a table where the data has wildcards. Example...

|ID  | Model  |
|1   | dv209% | 

I'm tryinh to write a sql query that will find row 1 when model='dv209AWW' or model='dv209asdfs'.

Any help would be appreciated.

2条回答
【Aperson】
2楼-- · 2019-09-21 12:43

Try this:

SELECT Id, Model
FROM yourTable
where model LIKE 'dv209%'

So it will find the row when the value is dv209AWW or dv209asdfs

查看更多
趁早两清
3楼-- · 2019-09-21 13:04

use LIKE

select id, model
from your_table
where 'dv209AWW' like model
order by id 
查看更多
登录 后发表回答