-2

I want to get to know the SQL query to find names of a column (egCustomerName) whose names having (anyletter) ‘l’ as the third letter

  • I think you are looking for the SQL mid function. http://www.w3schools.com/sql/sql_func_mid.asp – Newd Jun 30 '15 at 13:00

3 Answers3

3

Try this query

select * from tablename where CustomerName like '__I%'
Mukesh Kalgude
  • 4,814
  • 2
  • 17
  • 32
1

You can get 3rd letter by using SUBSTRING.

Try something like this:

SELECT egCustomerName
FROM Table
WHERE SUBSTRING(egCustomerName, 3, 1) = 'l'
0

Can achieve this with both RIGHT and LEFT functions.

Query

select name from tblName
where right(left(name,3),1)='l';

Fiddle demo here

And can achieve this with SUBSTRING,LIKE,MID also.

Ullas
  • 11,450
  • 4
  • 33
  • 50