久久久久久久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)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 亚洲精品久久久一区二区三区 | 亚洲三区在线观看 | 色综合一区二区 | 精品在线免费观看视频 | 中文在线播放 | 亚洲情综合五月天 | 免费国产视频在线观看 | 国产一区二区三区在线 | 日本中文字幕一区 | 色综合成人网 | 黄色一级电影免费观看 | 浴室洗澡偷拍一区二区 | 一级一级一级毛片 | 亚洲人成人一区二区在线观看 | 国产一区二区三区 | 色偷偷噜噜噜亚洲男人 | 久久久久免费观看 | 久久99国产精品 | 午夜精品福利视频 | 久久狠狠 | 日本精品视频 | 亚洲区一区二 | 亚洲欧美综合精品另类天天更新 | 久久99精品国产自在现线小黄鸭 | 欧美激情一区 | 成人免费在线观看视频 | 亚洲国产精品一区二区三区 | 亚洲美女网站 | 久久美女网 | 亚洲欧美国产一区二区三区 | 国内精品视频在线观看 | 国产日韩欧美在线 | 成人a视频片观看免费 | 精品久久久久久久久久久 | 一区二区三区视频在线观看 | a毛片| 国产区免费视频 | 成人精品一区二区三区中文字幕 | 欧美影院 | 国产999精品久久久 日本视频一区二区三区 | 人人干人人舔 |