亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

SQL Server將CSV分成多行

SQL Server將CSV分成多行

Qyouu 2019-12-06 10:50:13
我知道之前曾有人問過這個問題,但由于某種原因我無法使其正常工作。我正在使用來自此SQL Team線程(第二篇文章)和以下查詢的split函數。--This query converts the interests field from text to varcharselect    cp.id    ,cast(cp.interests as varchar(100)) as interestsinto #client_profile_tempfrom    client_profile cp--This query is supposed to split the csv ("Golf","food") into multiple rows            select    cpt.id    ,split.datafrom    #client_profile_temp cpt    cross apply dbo.split(    cpt.interests, ',') as split  <--Error is on this line但是我正在Incorrect syntax near '.'我在上面標記的錯誤。最后,我要ID              INTERESTS000CT00002UA    "Golf","food"成為ID              INTERESTS000CT00002UA    "Golf"000CT00002UA    "food"我正在使用SQL Server 2008,并將答案基于此StackOverflow問題。我對SQL還是很陌生,所以其他任何智慧的話也將不勝感激。
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 644 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號