1. 怎麼將兩個結果集加到一起【sql】
union all忽略向同值
select a.sensorid sensorid ,'2008-10-19 '||to_char(t.time1,'hh24') cptime from usedseninfotab a,time_interval t where
a.sensorid=318 union all
select a.sensorid sensorid ,'2008-10-20 '||to_char(t.time1,'hh24') cptime from usedseninfotab a,time_interval t where
a.sensorid=318
2. Oracle 查詢2個表結果集如圖,怎麼寫sql
sql寫法如下:
select a.name, a.type1, a.type2, b.type3, b.type4
from A a
inner join B b
on a.name = b.name
效果展示:
3. sql語句怎麼把查詢的結果插入表中
insertintotable1(id,sex,age)select1,'man',agefromtable2wherename='b'
4. 請問怎樣才能把我的textbox1的值放到sql語句裡面再查詢啊,謝謝 在線等
string sql = ("select * from table_1 where name='" + textBox1.Text + "'");
5. sql中怎樣把一個查詢結果存入到另一個資料庫
1、可以導出到excel 然後在導入到另外一個資料庫
2、可以和另外一個資料庫建立遠程鏈接,然後直接進行關聯操作
6. 將查詢結果集插入數據表的SQL語句怎樣寫
INSERT INTO 表X(列A,列B,列C…)SELECT 列1,列2,列3… FROM 表B WHERE條件 注意,查詢結果集: 對應列的數據類型要和插入的列的一樣。 列的數目也要一樣。
如果兩張表的結構一樣,直接
INSERT INTO 表A SELECT * FROM 表B
7. 將查詢結果集插入數據表的SQL語句怎樣寫
insert into Invalid(userID, Date)
select userID,convert(varchar(10),jobdetail.begintime,23) jobDate
from jobdetail
where convert(varchar(10),jobdetail.begintime,23) >= '2011-09-28'
and userID = @userID
group by userID,convert(varchar(10),jobdetail.begintime,23)
having sum(datediff(mi,jobdetail.begintime,jobdetail.endtime)*1.0) -5 > datediff(mi,min(jobdetail.begintime),max(jobdetail.endtime))