How to get all records from a table, which contains letter 'a' in their names?
How to get all records from a table "employee", which contains letter 'a' in their last names? this the question in recruitment test i came across with, as far as i know there is no last name and first name,it is a single name like King,John etc
But nevertheless how v can write its query?
Vijaya KadiyalaPosted Apr 5, 2009, 7:24 AM
There are couple of questions:
1) The Last Name Should start with "a" or Last Name contains occurence of "a"?
2) The Column Value that you are seeing always contains the "," to differentiate First Name and Last Name??
Your query varioesbased on the above questions.
Thanks -- Vijaya Kadiyala
www.DotNetVJ.com
Mahesh ChandPosted Mar 26, 2009, 12:59 AM
You use SELECT...FROM .. WHERE ..LIKE syntax.
SELECT name FROM table WHERE name LIKE 'a%'
Rajendra DeopuraPosted Mar 25, 2009, 11:42 PM
You can use Regex( ) class from System.Text.RegularExpressions namespace to achieve the result.
For any other query, Contact me on
[email protected]
Thanks