49

How do I select rows where a column value starts with a certain string ?

For example, I'd like to select the rows whose 'name' column starts with "Mr.".

Phillip
  • 5,366
  • 10
  • 43
  • 62

1 Answers1

86

You can do

select * from mytable where name like "Mr.%"

See http://www.sqlite.org/lang_expr.html

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758