Table1
Id, name, addresses 101,raja ,chennai
Table2
Id,group,name 101,a,siva 102,b,selva
I want retrieve data from two tables like Table2.group=a and two table Id must equal then take address from table1 display Id, name, Address, group
Table1
Id, name, addresses 101,raja ,chennai
Table2
Id,group,name 101,a,siva 102,b,selva
I want retrieve data from two tables like Table2.group=a and two table Id must equal then take address from table1 display Id, name, Address, group
What have you tried so far? Have you taken a look at some of the resources here?
Since this is the type of pretty straightforward SQL query you're likely to do many times over, it's worth you reading the tutorials and learning it yourself. I'll give you a few pointers to begin:
Your two tables are connected by the Id
field (most likely, this is the primary key for one table and the foreign key for another). You'll need to JOIN
these two tables using that field.
You'll need to specify a WHERE
clause to filter for your condition that Table2.group = a
.
The fields you want to display can all be specified using SELECT
. If you are selecting data FROM
Table 1 and joining to Table 2, you won't need to specify the table name before the field name.