mysql - Result from one query to another -
table 1 id subject category 1 news category1 2 amusement category2 3 sport category3 4 home category4 table 2 id name subject 1 mark sport 2 mark amusement 3 david sport 4 fred home
i need rows table 1 mark in table 2 corresponds to. in other words need row 2 , row 3 result table 1. need @ table 2 before know in table 1. mark take outcome of rows in table 1. appreciate help can get? (using mysql btw)
this simple join, using subject key.
select * table2 inner bring together table1 on table2.subject = table1.subject table2.name = 'mark'
which (one line example):
table2.id | table2.name | table2.subject | table1.id | table1.subject | table1.category 1 mark sport 3 sport category3
mysql
No comments:
Post a Comment