sql - Create a mysql view that contains 1 field getting in two data -
table1
id | filename | created
table2
id | filename | created
(note: filename consists of images names)
when run code below:
'column 'filename' in field list ambiguous'
appears
if specified the filename 'p.filename'
create or replace view vmedia select filename table1 p1 left join table2 p2
question: possible make mysql view consists of 1 field has field data of 2 tables?
this link answered question
create view vmedia select 'table1media' which, id, filename, created table1 union select 'table2media' which, id, filename, created table2 union select 'table3media' which, id, filename, created table3 ;
Comments
Post a Comment