mihral
mihral

Reputation: 353

Search the database for a string

How can I create a results set that shows all the names from the database(all entities) that contain a certain letter, for example a.

I am a begginer in sql.

I know I can use LIKE '%a%' but I don't know how to search in database.

Summary I want to search all the columns that have %name% and if is 'a' in those columns

Upvotes: 1

Views: 31

Answers (1)

Ankirama
Ankirama

Reputation: 498

We don't know what your table contains so I'll suppose we have at least a "name" field:

SELECT * FROM your_database_name WHERE name LIKE '%a%';

Upvotes: 2

Related Questions