我的表格看起来像这样:
123456(POC)
654656(GSON)-9576767(VID)
55555
546464(XML)-545454
我想要这样的输出:
ntpdate -bu <ntp server>
答案 0 :(得分:0)
使用CASE ....
SELECT
CASE WHEN NUMBER_NEW=NUMBER_OLD THEN NUMBER_NEW
ELSE NUMBER_NEW+'-'+NUMBER_OLD END AS 'SOMECOLUMN'
FROM
YOURTABLE
输出
123456(POC)
654656(GSON)-9576767(VID)
55555
546464(XML)-545454