Make sql view editable

前端 未结 1 935
眼角桃花
眼角桃花 2021-01-22 00:39

I\'ve made this sql view to combine some tables and it works, but it\'s not editable (i can\'t insert, delete, edit) data directly in it, but only if i do so in

相关标签:
1条回答
  • 2021-01-22 01:07

    In MySQL you cannot update a view that has "LEFT JOIN", however if you can convert those to "JOIN" you should be OK.

    Create view table4 as
    Select table1.firstname, table1.lastname, table2.bodyweight, table3.bodyfat
    From table1
    JOIN table2 ON table1.table1_id = table2.table2_id;
    JOIN table3 ON table1.table1_id = table3.table3_id;
    

    See here for reference to what is allowed in updatable views.

    0 讨论(0)
提交回复
热议问题