本文介紹了幫助使用 TSQL - 一種獲取行的第 N 列中的值的方法?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我希望找到一種方法來獲取數據集的第 N 列中的值.
I hope to find a way to get the value in the Nth column of a dataset.
因此,對于 N = 6 我想要
Thus, for N = 6 I want
SELECT (Column6Value) from MyTable where MyTable.RowID = 14
有沒有辦法在 SQL Server 2005 中實現的 TSQL 中做到這一點?謝謝.
Is there a way to do this in TSQL as implemented in SQL Server 2005? Thanks.
推薦答案
你應該可以加入系統目錄(Information_Schema.Columns)來獲取列號.
You should be able to join with the system catalog (Information_Schema.Columns) to get the column number.
這篇關于幫助使用 TSQL - 一種獲取行的第 N 列中的值的方法?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!