G Guest Jun 14, 2005 #1 What is a union query? When should it be used and when should it not be used? Thanks in advance for the help.
What is a union query? When should it be used and when should it not be used? Thanks in advance for the help.
M Marshall Barton Jun 14, 2005 #2 JV said: What is a union query? When should it be used and when should it not be used? Click to expand... A UNION query tacks the data records of one query onto the data records of another query. E.g.if you have two tables: table1: nm v -------- A 1 B 2 table 2 txt num ------------ X 3 Y 4 then the union query: SELECT nm, v FROM table1 UNION SELECT txt, num FROM table2 will return the data records: nm v -------- A 1 B 2 X 3 Y 4 UNION queries are rarely needed in a propery normalized database.
JV said: What is a union query? When should it be used and when should it not be used? Click to expand... A UNION query tacks the data records of one query onto the data records of another query. E.g.if you have two tables: table1: nm v -------- A 1 B 2 table 2 txt num ------------ X 3 Y 4 then the union query: SELECT nm, v FROM table1 UNION SELECT txt, num FROM table2 will return the data records: nm v -------- A 1 B 2 X 3 Y 4 UNION queries are rarely needed in a propery normalized database.