How can I join two SQL tables, putting a value from the 2nd table into a column in the 1st? -


i've no idea start this! have 2 tables, 1 shows company mobile phone bill in detail, this:

enter image description here

and table shows line rental, this:

enter image description here

i want "merge" 2 tables, line rental value shown in call cost column, value "line rental" shown in call class column, , bill date shown in date column:

enter image description here

try this

select user,callcost,callclass,date 1sttable union select user,linerental,'line rental',billdate 2ndtable 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -