table1
[ id - title - content - class ]
[ 1 - 2 - 3 - 1 ]
[ 1 - 2 - 3 - 2 ]
table2
[ id - data - permission - class ]
[ a - b - c - 1 ]
[ a - b - c - 2 ]
How can i select the column data
from table2 while selecting all table1
my query is SELECT title, content FROM table1 WHERE class = 1
How can i select column data
and permission
in this query?
You can do this with a simple JOIN
:
Select T1.*, T2.Data, T2.Permission
From Table1 T1
Join Table2 T2 On T1.Class = T2.Class
Where T1.Class = 1
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments