I want to make a dynamic Sitemap. But the problem is I have different Tables with url. How can bring It in one query ,I know answer is already there but I am not understanding Please guide
TABLE A
| id | addpage |
-------------------------------------------------------------
| 1 | https://stackoverflow.com/questions/ask|
| | |
| | |
| | |
TABLE B
| id | pagename |
-------------------------------------------------------------
| 1 | https://stackoverflow.com/questions/ask|
| | |
| | |
| | |
TABLE C
| id | pagename |
-------------------------------------------------------------
| 1 | https://stackoverflow.com/questions/ask|
| | |
| | |
| | |
use SQL UNION Operator (learn more)
The UNION operator is used to combine the result-set of two or more SELECT statements.
- Every SELECT statement within UNION must have the same number of columns
- The columns must also have similar data types
- The columns in every SELECT statement must also be in the same order
SELECT column_name(s) FROM table1
UNION
SELECT column_name(s) FROM table2;