41

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,017
  • 9
  • 40
  • 61

1 Answers1

76

You can do

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

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

Denys Séguret
  • 355,860
  • 83
  • 755
  • 726