Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to join two tables permanently with SQL?

Tags:

sql

join

mysql

view

Is it possible to join two tables permanently? Where I am just going to execute once that query and then after that it can be already joined automatically even if I exit DBMS?

like image 818
user962206 Avatar asked Dec 28 '25 15:12

user962206


1 Answers

You may want to look into creating a view.

A view is essentially a stored SQL statement that you can query like you would a table.

create view MyView as
    select TableA.Field1, TableB.Field2
    from TableA
    join TableB on TableB.ID = TableA.ID


select *
from MyView
like image 115
Bert Avatar answered Dec 31 '25 07:12

Bert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!