[英]Is there a way to bulk insert certain data from a query in SQL to another column with the same row within the same table?
[英]Is there a way, to bulk insert into SQL table, if the file, that contains the data is unformatted?
首先,嗨,所以基本上我在 txt 文件中有一堆數據(約 150 萬行)。 我想將它批量插入 SQL 表中,問題是。 它只有 1 列,所有內容都在新行中; 它看起來像這樣;
DateAndTime
VarType = "xy"
Data = "xy"|
Angle1
VarType = "xy"
Data = "xy"|
Angle2
VarType = "xy"
Data = "xy"
等等。 在我創建的表中,我的列是“DateAndTime”、“Angle1”、“Angle2”等。從我提供的示例中,我只需要數據的名稱(如“Angle1”)作為列 header,以及“數據”。 我完全迷路了,我不知道該怎么辦。 先感謝您!
我偏向於SQL,所以我可能會采取以下方法:
(3) 相當復雜,我不能 100% 確定我理解這個過程。 但想法是:
dateandtime
和時間的累積總和。lag(-2)
獲取數據行的名稱。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.