久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

SQL:如何更新多個字段,以便將空字段內容移動到

SQL: How to update multiple fields so empty field content is moved to the logically last columns - lose blank address lines(SQL:如何更新多個字段,以便將空字段內容移動到邏輯上最后一列 - 丟失空白地址行) - IT屋
本文介紹了SQL:如何更新多個字段,以便將空字段內容移動到邏輯上最后一列 - 丟失空白地址行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有三個地址行列,aline1、aline2、aline3 表示一條街道地址.從不一致的數據上演,它們中的任何一個或全部都可以空白的.我想將第一個非空白移動到 addrline1,第二個非空白到 addrline2,如果沒有三個非空??行,則清除第 3 行,否則離開它.(第一個"意味著 aline1 是第一個,除非它是空白的,如果 aline1 為空,則 aline2 是第一個,如果 aline1 和 2,則 aline3 是第一個都是空白)

I have three address line columns, aline1, aline2, aline3 for a street address. As staged from inconsistent data, any or all of them can be blank. I want to move the first non-blank to addrline1, 2nd non-blank to addrline2, and clear line 3 if there aren't three non blank lines, else leave it. ("First" means aline1 is first unless it's blank, aline2 is first if aline1 is blank, aline3 is first if aline1 and 2 are both blank)

這個臨時表中的行沒有鍵,可能有重復的行.我可以添加一個密鑰.

The rows in this staging table do not have a key and there could be duplicate rows. I could add a key.

不計算列舉可能的大case語句空白和非空白的組合并移動字段,如何我可以更新表格嗎?(同樣的問題出現了更多超過 3 行,所以這就是為什么我不想使用 case 語句)

Not counting a big case statement that enumerates the possible combination of blank and non blank and moves the fields around, how can I update the table? (This same problem comes up with a lot more than 3 lines, so that's why I don't want to use a case statement)

我使用的是 Microsoft SQL Server 2008

I'm using Microsoft SQL Server 2008

推薦答案

您可以創建一個插入和更新觸發器,檢查字段是否為空,然后移動它們.

You could make an insert and update trigger that check if the fields are empty and then move them.

這篇關于SQL:如何更新多個字段,以便將空字段內容移動到邏輯上最后一列 - 丟失空白地址行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個子標記轉換為具有多個分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個表創建視圖?)
Create calculated value based on calculated value inside previous row(根據前一行內的計算值創建計算值)
How do I stack the first two columns of a table into a single column, but also pair third column with the first column only?(如何將表格的前兩列堆疊成一列,但也僅將第三列與第一列配對?) - IT屋-程序員軟件開發技
Recursive t-sql query(遞歸 t-sql 查詢)
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 一级做a爰片性色毛片16美国 | 一级黄色夫妻生活 | 99热在这里只有精品 | 国产中文字幕亚洲 | 中文在线a在线 | 欧美三级在线 | 久久黄色网 | 热99在线| 日韩精品亚洲专区在线观看 | 国产免费观看久久黄av片涩av | 日韩免费一二三区 | 免费一区二区 | 国产精品久久久久一区二区三区 | 秋霞a级毛片在线看 | 8x国产精品视频一区二区 | 99re6在线视频精品免费 | 日韩欧美视频网站 | 涩涩片影院 | 国产精品久久久久久久久久久久久 | 日韩一区二区三区在线 | 四虎在线播放 | 欧美一区二区三区视频在线观看 | 91精品国产欧美一区二区成人 | 91资源在线播放 | 国产精品18久久久久久白浆动漫 | 国产免国产免费 | 久久久久久成人 | 国产99久久精品一区二区永久免费 | 中文成人在线 | 久久久久久精 | 日日拍夜夜 | 国产精品亚洲一区 | 国产欧美一区二区在线观看 | 九九免费视频 | 免费在线观看一区二区 | av在线免费不卡 | 色接久久 | 日韩免 | 人人玩人人干 | 成人精品一区二区三区中文字幕 | 91视频导航 |