开发者

Combination of columns in where condition

开发者 https://www.devze.com 2023-04-06 06:58 出处:网络
I have a clarification in SQL where condition, how do I use multiple columns combination in where conditions?

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)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号