views:

75

answers:

6

hi, I have a question that how can we use SELECT for searching the name which start with 'A' in MySQL table? thanks

+3  A: 

MySQL docs

... LIKE 'A%'

(the first part of the query should be easy for you)

Bozho
why the downvote? Because I didn't write the obvious parts for educational purposes?
Bozho
+2  A: 

Using the LIKE operator, e.g.:

SELECT lastName FROM yourTable WHERE lastName LIKE 'A%'
T.J. Crowder
+1  A: 
SELECT name FROM <tablename> WHERE name like "A%"
tangens
+1  A: 

You use the LIKE command. The % is a wildcard.

SELECT * FROM table WHERE column like 'A%';
Oli
+4  A: 

SELECT * FROM table_name WHERE columnname LIKE 'A%'

Ralph Stevens
+1  A: 

http://www.w3schools.com/SQl/sql_wildcards.asp

SELECT * FROM Persons
WHERE Name LIKE 'A%'
Charles Beattie