I need to merge two SELECT statements.
There are two tables in my database, where table A consists of two fields; Type and Counter. Table B consists of two fields; Source and destination.
Table A has three items; { 1, 5000 }, { 2, 10000 } and { 3, 15000 }. ({Type, Counter}) Table B has two items; { 5000, 10000 } and { 10000, 150000 }. ({Source, Destination})
That is, table B's values consist of data from table A.
The data I have available for my query are Type in table A (1, 2 and 3).
The end result of a query (the one I'm after) to the database should be one item; { 5000, 10000, 15000 }, where columns should read {Source, Middle, Destination}, respectively. However, I've been unable to create a query that can appear in such format.
I am able to get the data using an INNER JOIN, where the result appear as two items; { 5000, 10000 } and { 10000, 15000 }. (Not simply the content of table B that is, if the tables would consist of other items, as well.)
(There's obviously far more items in both tables than I've displayed above.)
So, how can I write the SQL query to make my result appear as { 5000, 10000, 15000 } (with appropriate column names)?