我使用visual foxpro 6.0。我想加入2个表:
studnum studname sec course
01 franz 1a bsct
studnum studname sec course
02 simon 1b bsct
我希望它是这样的:
studnum studname sec course
01 franz 1a bsct
02 simon 1b bsct
我该怎么做?
答案 0 :(得分:1)
SELECT studnum, studname, sec, course ;
FROM table1 ;
UNION ALL ;
SELECT studnum, studname, sec, course ;
FROM table2 ;
INTO CURSOR Table3
答案 1 :(得分:0)
有几种方法可以做到这一点。
从命令窗口或程序文件(.prg)
*Since the table structures are the same
SELECT table1
APPEND FROM table2
或
*using a SQL statement
INSERT INTO table1 (studnum, studname, sec, course) ;
SELECT studnum, studname, sec, course ;
FROM table2
*optional where or order by condition