watsmyname Posted April 21, 2011 Share Posted April 21, 2011 Hello I have two tables tableA and tableB. These table have same structure except that tableB has three more columns than tableA. All i want to do is create one mysql VIEW named "mysqlView", taking these two tables with extra one column 'from_table'. if the rows are from tableA this field will have value A and when from tableB it has value B. Can anybody help me on this?? thanks watsmyname Quote Link to comment https://forums.phpfreaks.com/topic/234329-creating-mysql-view/ Share on other sites More sharing options...
fenway Posted April 24, 2011 Share Posted April 24, 2011 You mean like a JOIN? Quote Link to comment https://forums.phpfreaks.com/topic/234329-creating-mysql-view/#findComment-1205575 Share on other sites More sharing options...
watsmyname Posted April 26, 2011 Author Share Posted April 26, 2011 thanks for the reply, yes like a join, but here we've to join two tables to create one view. This view contains all the columns of both tables plus one extra column to specify whether the row is from table A or table B. Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/234329-creating-mysql-view/#findComment-1206243 Share on other sites More sharing options...
fenway Posted April 26, 2011 Share Posted April 26, 2011 I'm not sure I understand why you need to know... unless these two tables were UNION-able. Quote Link to comment https://forums.phpfreaks.com/topic/234329-creating-mysql-view/#findComment-1206394 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.