how to display employee names starting with a and then b in sql

list all the employees whose name starts with 's
query to display name ends with 'a'
query to display name starts with 'a' in access
write a query to display all 6-letter names that start with p and end with a
how to display name in sql
first letter must start with 'c' in sql
sql query to find name contains a
get employee details from employee table whose first name starts with 'j

i want to display the employee names which having names start with a and b ,it should be like list will display employees with 'a' as a first letter and then the 'b' as a first letter...

so any body tell me what is the command to display these...


To get employee names starting with A or B listed in order...

select employee_name 
from employees
where employee_name LIKE 'A%' OR employee_name LIKE 'B%'
order by employee_name

If you are using Microsoft SQL Server you could use

....
where employee_name  LIKE '[A-B]%'
order by employee_name

This is not standard SQL though it just gets translated to the following which is.

WHERE  employee_name >= 'A'
       AND employee_name < 'C' 

For all variants you would need to consider whether you want to include accented variants such as Á and test whether the queries above do what you want with these on your RDBMS and collation options.

You could use LIKE for that. Try something like this query: T-SQL: Hide Copy Code. SELECT Name FROM Employees WHERE Name LIKE  Write a query that displays the first name and the length of the first name for all employees whose name starts with the letters 'A', 'J' or 'M'. Give each column an appropriate label. Sort the results by the employees' first names.


select columns
  from table
 where (
         column like 'a%' 
      or column like 'b%' )
 order by column asc

Write a query that displays the first name and the length of the first name for all employees whose name starts with the letters 'A', 'J' or 'M'. Previous:Write a query to find the name (first_name, last_name) of the employees who are not supervisors. Next: Write a query to display the employee ID, first name, last name, salary of all employees whose salary is above average for their departments.


Regular expressions work well if needing to find a range of starting characters. The following finds all employee names starting with A, B, C or D and adds the "UPPER" call in case a name is in the database with a starting lowercase letter. My query works in Oracle (I did not test other DB's). The following would return for example: Adams adams Dean dean

This query also ignores case in the ORDER BY via the "lower" call:

SELECT employee_name 
FROM employees
WHERE REGEXP_LIKE(UPPER(TRIM(employee_name)), '^[A-D]')
ORDER BY lower(employee_name)

This is telling SQL to get records where first letter is T , then % tells is to search for anything and the last letter is R. 10.2k views · View 3 Upvoters. SQL JOINS on HR Database: Exercise-1 with Solution. 1. Write a query in SQL to display the first name, last name, department number, and department name for each employee.


select employee_name 
from employees
where employee_name LIKE 'A%' OR employee_name LIKE 'B%'
order by employee_name

SQL statement to retrieve names beginning with A or S or Z. Is there any statement like select * from table where name like (A% , S%, Z%). MySQL Restricting and Sorting Data: Exercise-8 with Solution. Write a query to display the last name of employees having 'e' as the third character.


What cfengineers said, except it sounds like you will want to sort it as well.

select columns
  from table
 where (
         column like 'a%' 
      or column like 'b%' )
order by column

Perhaps it would be a good idea for you to check out some tutorials on SQL, it's pretty interesting.

SELECT [Last Name], City FROM Customers WHERE City Like “B*”; For more information see Access SQL: basic concepts, vocabulary, and syntax and The following example returns data that begins with the letter P followed by any letter​  SQL QUERIES. Display the employee number, name, salary, and salary increased by 15% expressed as a whole number. Modify the previous query to add a column that will subtract the old salary from the new salary. Label the column Increase. Display the employee's name, hire date, and salary review date, which is the first Monday after six months of


Sql LIKE command to match different strings and chars in a record field of We can see the result above list out all the names starting with name John. First the Script should connect to MySQL database and then records can be displayed. I want to get the information like SELECT * FROM employee WHERE name LIKE  select * from table where name like (A% , S%, Z%) or is the below query only the solution. select * from table where name like 'A%' or name like 'S%' or name like 'Z%'


The column names that follow the select keyword determine which columns will be data values or rows will be returned or displayed, based on the criteria described after the keyword where. This SQL statement will match any first names that start with 'Er'. Display the first name and age for everyone that's in the table. select name from employees where name like ‘T%’; It returns the name of employee starts with letter ‘T’ but it does not care about ending letter. Query: select name from employees where name like ‘%R’; It returns the name of employee ends with letter ‘R’ but it does not care about starting letter.


WHERE CustomerName LIKE 'a%', Finds any values that starts with "a". WHERE 6, Blauer See Delikatessen, Hanna Moos, Forsterstr. 57, Mannheim, 68306 11, B's Beverages, Victoria Ashworth, Fauntleroy Circus, London, EC2 5NT, UK. I want a SQL query to select those employee whose Names range between A to E and so on. When a user click on the link A-E , it should display all the employee name starting from A to E. Thanks in advance.