0
我在表中有兩列。兩者是不同長度的nvarchar
,讓我們說第一個欄包含(代表國家)的顏色和其他列包含與其他文本如國名在SQL Server 2008中使用SQL根據其他列提取特定字符串
Color text
green choosen country: UNITED STATES *some text no fixed length upto 1000 chars*
black chossen country: S AFRICA *some text no fixed length upto 1000 chars*
red choosen country: INDIA *some text no fixed length upto 1000 chars*
現在我想的顏色和國名串接在我的輸出,作爲
green,UNITED STATES
black,S AFRICA
red,INDIA
只要選擇'text',只需用空字符串替換'choosen country:'即可。 – DigiFriend
是固定的文本列格式嗎?即「選擇的國家:」總是存在的? –
hi Vkp,是選擇的國家總是存在 – Vicky