![alt text] [1]嗨,请给我复制和粘贴的SQL代码。我需要根据照片链接http://i566.photobucket.com/albums/ss105/nrfollowup1/delete.jpg
获得所需的输出我需要删除破折号后面的所有字符
SELECT SYSADM_PURC_ORDER_LINE.PURC_ORDER_ID 来自SYSADM_PURC_ORDER_LINE;
答案 0 :(得分:0)
SELECT IIF(INSTR(s.PURC_ORDER_ID,'-'),MID(s.PURC_ORDER_ID, 1, INSTR(s.PURC_ORDER_ID,'-')-1), s.PURC_ORDER_ID) as DesiredOutput
FROM SYSADM_PURC_ORDER_LINE.PURC_ORDER_ID s;