I've no idea where to start with this! I have two tables, one which shows a company mobile phone bill in detail, like this:
And another table which shows line rental, like this:
I want to "merge" the two tables, so that the Line Rental value is shown in the Call Cost column, the value "Line Rental" is shown in the Call Class column, and the Bill Date is shown in the Date column:
Try this
select User,callcost,callclass,date from 1sttable
union all
select User,LineRental,'Line Rental',billdate from 2ndtable
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.