我有两张桌子" aux1.txt"
CREATE TABLE aux1
(
"date/time" DATE,
year INTEGER,
month INTEGER,
day INTEGER,
"data quality" TEXT,
"max temp" REAL,
"max temp flag" TEXT,
"min temp" REAL,
"min temp flag" TEXT,
"mean temp" REAL,
"mean temp flag" TEXT,
"heat deg days" REAL,
"heat deg days flag" TEXT,
"cool deg days" REAL,
"cool deg days flag" TEXT,
"total rain" REAL,
"total rain flag" TEXT,
"total snow" REAL,
"total snow flag" TEXT,
"total precip" REAL,
"total precip flag" TEXT,
"snow on grnd" REAL,
"snow on grnd flag" TEXT,
"dir of max gust" REAL,
"dir of max gust flag" TEXT,
"spd of max gust" REAL,
"spd of max gust flag" TEXT
);
有历史天气数据和另一个名为" Weather.txt"
CREATE TABLE weather
(
year INTEGER,
month INTEGER,
day INTEGER,
"max temp" REAL,
"min temp" REAL,
"mean temp" REAL,
"total precip" REAL
);
其中一些专栏。如果Max Temp,Min Temp,Mean Temp,Total Precip字段都不为空,我只想在天气中插入aux1中的所有相关列。到目前为止,我已经:
INSERT INTO weather
SELECT "max temp" REAL,
"min temp" REAL,
"total precip" REAL
FROM aux1
WHERE "max temp" IS NOT NULL
AND "max temp" <> ""
虽然看起来好像这适用于&#34; Max Temp&#34;我不确定如何继续为所有其他人继续这种语法。任何方向都表示赞赏!
由于
答案 0 :(得分:0)
为什么不简单:
<repositories>
<repository>
<id>nexus</id>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>https://www.google.com/anythingCanGoHere</url>
<layout>default</layout>
</repository>
</repositories>
答案 1 :(得分:0)
INSERT INTO weather
SELECT "max temp" REAL,
"min temp" REAL,
"total precip" REAL
FROM aux1
WHERE "max temp" IS NOT NULL AND
"min temp" IS NOT NULL AND
"total precip" IS NOT NULL
field <> ""