AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.



corejava-jdbc: How to merge two tables data using JDBC?

i have a two tables like employee table & department table in oracle database. Now i want to merge these two table. how can i merge these two tables.

Could you please explain the concept with sample code.

corejava x 348
jdbc x 32
Posted On : 2016-09-08 08:51:13.0
profile MOHAMMAD SALEEM BASHA - anyforum.in MOHAMMAD SALEEM BASHA
266150
up-rate
3
down-rate

Answers


If there are two tables you want to merge there must be one foreign key relation between them. Suppose in employee table you have department id for each employee. and department id belongs to department table. and you want to print employee name and department name. use below query:

select e.emp_name, d.dept_name from employee e, department d where e.dept_id=d.dept_id;

above query will return employee name and its department name.

Posted On : 2016-09-09 13:16:46
Satisfied : 1 Yes  0 No
profile Rishi Kumar - anyforum.in Rishi Kumar
523186220845
Reply This Thread
up-rate
5
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in