I have a clarification in SQL where condition, how do I use multiple columns combination in where conditions?
For example:开发者_Python百科
select *
from employees
where employee_firstName+employee_lastName = @emp_FirstName+@emp_LastName
I want the combination of the two parameters together.
I am using Sybase. Can anyone help me please?
I can't test it, but should work faster:
select *
from employees
where employee_firstName = @emp_FirstName
and employee_lastName = @emp_LastName
you should use concatenation operator, as described here:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.blocks/html/blocks/blocks248.htm
select *
from employees
where (employee_firstName+employee_lastName) = (@emp_FirstName+@emp_LastName)
精彩评论