Write an SQL query to find the names of employees starting with ‘A’. - www.studyandupdates.com

Sunday

Write an SQL query to find the names of employees starting with ‘A’.

Q 4. Write an SQL query to find the names of employees starting with ‘A’.


Ans: The LIKE operator of SQL is used for this purpose.

It is used to fetch filtered data by searching for a particular pattern in the where clause.

The Syntax for using LIKE is,


SELECT column1,column2 FROM table_name WHERE column_name LIKE pattern;


   

LIKE: operator namepattern: exact value extracted from the pattern to get

related data in

result set.

The required query is:


SELECT * FROM Employees WHERE EmpName like 'A%' ;







No comments:

Post a Comment

Popular Posts