Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear all,

SQL
select CustomerName=FirstName+ ' ' + LastName from tbCustomer
and result is Ramesh kumar gupta
how to search :- Ramesh or kumar Or gupta
or Remesh kumar or Remesh gupta or Kumar or gupta or kumar gupta

how to search in sql server with all condition which we mentions above search condition.
Posted
Updated 13-Feb-13 18:59pm
v2

SQL
select * from tblCustomer where CustomerName like 'R%' or CustomerName like 'k%' or CustomerName like 'g%'


try something like above and u will ultimately get the desired result..

hope it helps..

regrds
anurag
 
Share this answer
 
Where FirstName like '%Ramesh%' or LastName like '%Ramesh%'
or FirstName like '%Kumar%'


etc.


This assumes that your db has been created as case insensitive and that you don't REALLY want to include Remesh when you search for Ramesh
 
Share this answer
 
Try this..

i assume CustomerName is whatever you enter the data into textbox.

SQL
select * from table_name where Customer_name like '%CustomerName%'
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900