我们可以在Oracle中使用一个insert语句插入多行数据吗?

时间:2014-09-11 05:30:57

标签: sql oracle

如何将数据插入表格。

Insert into TEAMS (TEAM_CODE,TEAM_NAME,TEAM_DIVISION,TEAM_CITY,TEAM_STATE,TEAM_COACH,TEAM_STADIUM,TEAM_STAD_CAP)        
VALUES                    
('BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''),      
('BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''),      
('BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''),      
('BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''),      
('BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''),                    
('NEP','New England Patriots','AFC EAST','Foxboro','MA','Bill Belichek','Gillette Stadium','');           

我们可以使用一个命令插入多个数据吗?

1 个答案:

答案 0 :(得分:0)

Insert into TEAMS (TEAM_CODE,TEAM_NAME,TEAM_DIVISION,TEAM_CITY,TEAM_STATE,TEAM_COACH,TEAM_STADIUM,TEAM_STAD_CAP)
            select 'BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''
union select 'BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''
union select 'BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''
union select 'BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''
union select 'BUF','Buffalo bulls','AFC EAST','Buffalo','NY','Doug Marrone','Ralph Wilson Jr.Stadium',''
union select 'NEP','New England Patriots','AFC EAST','Foxboro','MA','Bill Belichek','Gillette Stadium','';