ID(int) Year(int) ------- --------- 10 2008 20 2009 30 2010
ID_Year (Output) ------- 10-2008 20-2009 30-2010
select Convert(nvarchar(50),ID)+'-'+Convert(nvarchar(50),Year) as ID_Year from tablename
SELECT (ID + '-' + year) AS ID_Year FROM tablename
select distinct cast(ID+ '-' + Year as varchar(100)) as newcolumn from tablename
SELECT Title, FirstName, lastName, ISNULL(Title,'') + ' ' + ISNULL(FirstName,'') + ' ' + ISNULL(LastName,'') as FullName FROM Customer
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)