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

SQL:如何更新多個(gè)字段,以便將空字段內(nèi)容移動(dòng)到

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

問(wèn)題描述

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

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)

這個(gè)臨時(shí)表中的行沒(méi)有鍵,可能有重復(fù)的行.我可以添加一個(gè)密鑰.

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

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

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

推薦答案

您可以創(chuàng)建一個(gè)插入和更新觸發(fā)器,檢查字段是否為空,然后移動(dòng)它們.

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

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

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

相關(guān)文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個(gè)子標(biāo)記轉(zhuǎn)換為具有多個(gè)分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個(gè)表創(chuàng)建視圖?)
Create calculated value based on calculated value inside previous row(根據(jù)前一行內(nèi)的計(jì)算值創(chuàng)建計(jì)算值)
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?(如何將表格的前兩列堆疊成一列,但也僅將第三列與第一列配對(duì)?) - IT屋-程序員軟件開發(fā)技
Recursive t-sql query(遞歸 t-sql 查詢)
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱轉(zhuǎn)換為日期/月份編號(hào)(問(wèn)題和答案的組合))
主站蜘蛛池模板: 99re在线视频 | 亚洲视频在线免费观看 | 国产精品一区二区久久精品爱微奶 | 天天操天天射天天 | 亚洲综合精品 | 日韩欧美一区二区三区四区 | 欧美精品啪啪 | 精品少妇v888av | 国产精彩视频在线观看 | 久久久久久久综合色一本 | 国产无人区一区二区三区 | 久久久www成人免费精品 | 五月婷婷亚洲 | 国产探花在线精品一区二区 | 久久精品国产亚洲 | 国产精品亚洲成在人线 | 91av视频在线播放 | 精品久久国产 | 久久国产区 | 一级做a爰片性色毛片 | jizz亚洲人 | 亚洲一区毛片 | 国产资源在线观看 | www亚洲精品| 成人黄色电影在线播放 | 免费久久99精品国产婷婷六月 | 成人影音| 国产精品成人久久久久a级 久久蜜桃av一区二区天堂 | 久久精品亚洲精品国产欧美 | 91中文字幕在线观看 | 日韩在线免费看 | 999国产精品视频免费 | va精品| 成人国产精品久久久 | 成人片免费看 | 成人欧美一区二区三区在线播放 | 国产精彩视频 | 精品久久久久久久久久久久 | 亚洲高清av在线 | 国产在线精品一区二区三区 | 日本大片在线播放 |