为两个或多个类似的行插入一行

时间:2017-01-19 06:29:54

标签: sql oracle10g

BOARDING_PT          DESTINATION          DISTANCE PRICE
-------------------- -------------------- -------- -----
PUNE                 MUMBAI                    400  2000 
PUNE                 HYDERABAD                 800  5000 
MUMBAI               PUNE                      410  2100 
PUNE                 BANGALORE                 900  4500 
HYDERABAD            PUNE                      800  5000 
BANGALORE            PUNE                     9000  4700 
--------------------------------------------------------

如何为Mumbai-Pune和Pune-Mumbai插入一行,同样为其他此类插入插入一行。

1 个答案:

答案 0 :(得分:0)

试试这个

INSERT INTO表(Boarding_Pt,目的地,距离,价格) SELECT Destination,Boarding_Pt,Distance,Price FROM Table