我從表中選擇BP(sys/dia)。我想將這些值分成兩個單獨的列。按'/'將值拆分爲單獨的列
CREATE TABLE #BP_INFO
(ID INT , NAME VARCHAR(10), BP VARCHAR(10))
INSERT INTO #BP_INFO
VALUES(1,'ABC','100/60')
,(2,'XYZ','120/70')
,(3,'GHD','110/55')
SELECT * FROM #BP_INFO
我想如下所示的結果:
ID NAME BP_SYS BP_DIA
1 ABC 100 60
2 XYZ 120 70
3 GHD 110 55