I\'m making switch from MySQL to SQL Server 2008 Express and can\'t seem to find a CONCAT()-esque function. I have two columns I\'m trying to combine into a string and find
You can use CONCAT in SQL 2008 (if you REALLY want) by wrapping in brackets
{fn CONCAT(id1,id2)} AS combo1
NOTE: CONCAT only takes two arguments, so you must nest them if you wish to concatenate more than two strings:
{fn CONCAT(id1,{fn CONCAT(id2,id3)})} AS combo2
CONCAT
doesn't exist in SQL Server 2008, it is new since SQL Server 2012.
You could use instead:
select id1, id2, id1 + ", " + id2 as combo1
FROM db1
group by combo1
Maybe something like,
SELECT DISTINCT id1, id2, id1 + ', ' + id2
would that work?