I have 2 tables. 1 table have 3 rows and another table have 5 rows. I wanted to join this both tables together and the result should show 3rows and 5 rows respectively. Is there any ways that could achieve that using sql statement? Any help will be appreciated.
Share
You can use
UNIONfor this,There are two basic rules of using
UNIONUNIONhas an optional parameterALL. if you omitALLparameter,UNIONwill distinctly display all unique records that were combined.As you can see, I have added a virtual column
OrderThis. This will be the basis for the ordering of your rows. But the Problem is it will show on your result list. the solution is by wrapping it in a subquery,