问题
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.
回答1:
use LIKE
select id, model
from your_table
where 'dv209AWW' like model
order by id
回答2:
Try this:
SELECT Id, Model
FROM yourTable
where model LIKE 'dv209%'
So it will find the row when the value is dv209AWW
or dv209asdfs
来源:https://stackoverflow.com/questions/15689624/using-wildcard-in-table-data