You need to use MySQL UNION .
SELECT id FROM table 1 UNION SELECT cno AS id FROM table2
In UNION you can combine results from two or more database tables.
But for this, the selected columns should be similar.
For example, if you extract 5 fields from one SQL and 6 fields from another SQL.
And making UNION from these two queries, this will not work.
The above SQL works because you select one column from SQL.
Pupil source share