根据您对我的评论,这就是您要查找的内容:
ALTER PROCEDURE PRO_NAME (Identification INT)
AS SELECT
CASE WHEN CONVERT(MobileAreaCode, int)>1 OR
CONVERT(Mobile, int)>1 THEN MobileAreaCode+Mobile
End FROM TABLE_NAME WHERE Hp=(Identification)
GO
较早的想法/信息..试试这个..
SET NOCOUNT ON
SELECT
CASE WHEN MobileAreaCode is NOT NULL OR Mobile is NOT NULL THEN
MobileAreaCode+Mobile
END
FROM
TABLE_NAME
WHERE
id = 123456789
另一种方式..
SET NOCOUNT ON
SELECT
CASE WHEN CONVERT(MobileAreaCode, int)>1 OR CONVERT(Mobile, int)>1 THEN MobileAreaCode+Mobile End
END
FROM
TABLE_NAME
WHERE
id = 123456789
使用 ISNULL..
SET NOCOUNT ON
SELECT
CASE WHEN NOT ISNULL(MobileAreaCode, 000) OR NOT ISNULL(Mobile, 000) THEN MobileAreaCode+Mobile End
END
FROM
TABLE_NAME
WHERE
id = 123456789