question

vpn005 avatar image
vpn005 asked

How to find all contacts starts with a letter in their last name in sql,

How to find all contacts starts with a letter in their last name in sql,

Example( jhon, bosco) in contact’s table , jhon is first and bosco is last name, how to find all contacts starts with a letter(eg:- b) in their last name,

Note. Fists name and last name in a single colum separated by comma

sql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
swarnava2014 avatar image
swarnava2014 answered

select * from [table_name] where SUBSTRING([column_name],CHARINDEX(',',[column_name],0)+2,1)='b'

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.