SQL Server 2008 Express CONCAT() 不存在? [英] SQL Server 2008 Express CONCAT() doesn't exist?

查看:128
本文介绍了SQL Server 2008 Express CONCAT() 不存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 MySQL 切换到 SQL Server 2008 Express,但似乎找不到 CONCAT() 式的函数.我有两列我试图组合成一个字符串并找到独特的组合.

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 unique combinations.

id1          id2
001          abc1
002          qrs5
003          qrs5
003          abc1
...           ...

当我尝试以下操作时:

  select id1, id2, concat(id1,  ", ", id2) as combo1
  FROM db1
  group by combo1

我收到以下错误消息:

消息 195,级别 15,状态 10,第 1 行
concat"不是可识别的内置函数名称.

Msg 195, Level 15, State 10, Line 1
'concat' is not a recognized built-in function name.

有什么建议吗?

推荐答案

也许像,

SELECT DISTINCT id1, id2, id1 + ', ' + id2

那行得通吗?

这篇关于SQL Server 2008 Express CONCAT() 不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆