I know that one can use UNION
on a select statement if count of columns in two tables is equal. Also, another option is using sub-query in the select clause. What else can I use?
Example:
tabel1 table2
id 1 1
2 2
3 3
I need to get the number of total rows from both tables in one query:
...COUNT(table1.id) as tbc1, COUNT(table2.id) as tbc2...