Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
alter proc sp_SearchEmpDetails
(
@f_EmpName varchar(50)
)
as
select * from t_EmpDetails where f_EmpName Like '%' +@f_EmpName+ '%'

What I have tried:

The below mentioned query is search varchar, but i need integer query
Posted
Updated 24-Aug-22 3:51am

1 solution

Names aren't integer values: "Mohamed Mubarack" or "OriginalGriff" cannot be added together, multiplied, or divided!

So unless you want to use a numeric field (INT, FLOAT, or DECIMAL) you can't use an "integer query".
If you do use a numeric field, then it's trivial:
SQL
SELECT * FROM MyTable WHERE Quantity > 0
Or:
SQL
SELECT * FROM MyTable WHERE Quantity < 100 
Or perhaps:
SQL
SELECT * FROM MyTable WHERE Quantity BETWEEN 0 AND 100
Or even:
SQL
SELECT * FROM MyTable WHERE Quantity IN (1, 2, 3)
 
Share this answer
 

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