Hi friends,

In one of my table I stored some names of students . I need to select all the names starting letter "A" or "a" .... Please help me

Thanks in advance
Rajeesh

Recommended Answers

All 2 Replies

Simplest answer to type: SELECT [I]whatever[/I] FROM [I]wherever[/I] WHERE [I]something[/I] LIKE 'A%' OR [I]something[/I] LIKE 'a%'; If you also care that the output be ordered: ... ORDER BY [I]something[/I]

You don't need to use 'A%' and 'a%' in WHERE. MySQL is case insensitive when comparing CARCHAR, CHAR and TEXT unless specified. So this query should be sufficient.

SELECT name FROM table WHERE name LIKE 'A%';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.