Use case statement
Select Case when Last_Name ='tiger' and first_name=' scott' then concat(Last_Name, first_name) else .............. end from employee
-----Original Message-----
From: SangeethaPriya R. [mailto:db2udbdba-ezmlmshield-x31257312.[Email address protected]
Sent: Tuesday, March 27, 2007 11:04 AM
To: LazyDBA Discussion
Subject: Reg. Select Query to combine two fields
Hi Friends,
I am having table named as Employee in that having fields
emp_first_name,emp_last_name.
Now in select query i want to fetch like below.
if Last Name is---tiger
and first_name is - scott then
the result would be tiger scott.
My Query: select emp_last_name + " " + emp_first_name as emp_name from
employee.
But it gives error. Please suggest me for this.
Thanks in advance.
Thanks and Best Regards,
Sangeetha Priya R.
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page