希望在MS SQL上从Select查询中打印自定义消息

时间:2012-03-14 15:27:02

标签: sql sql-server if-statement

我正在尝试从select中重新打印一个vaules但是,我在MSSQL中找不到方法。

我的意思是我有查询

select str_id,value from board (this is a simplify query, the one has several joins)

这个节目

CIM.MotherID,0xfffffff
CIM.MotherID,0x1234234

我想要得到的东西

Mother ID, Oxffffff
Mother ID, Ox123213

我试过IF声明,但我无法理解你有任何线索吗?

1 个答案:

答案 0 :(得分:0)

select STUFF(SUBSTRING(str_id,5,12),6,7,' '),value from board (this is a simplify query, the one has several joins)