I have a database called 'mylist'. In it tables exists as 'list1' 'list2' 'list3'. All tables contain same structure and column names however data is different.
If I have to select all data from all tables then what query should I run ?
Try using UNION among all of them to get all the rows like below:
SELECT output.mycol1, output.mycol2
FROM
(SELECT list1.mycol1, list1.mycol2
FROM list1
UNION
SELECT list2.mycol1, list2.mycol2
FROM list2
UNION
SELECT list3.mycol1, list3.mycol2
FROM list3) AS "output"
ORDER BY output.mycol1