May 6, 2008 at 4:31 am
Hi i am having three tables (EMPLOYEE,ADDRESS,QUALIFICATION).
The below is table structure
EMPLOYEE
id
name
pg
street
city
state
pg
ADDRESSstreet
city
state
QUALIFICATIONug
pg
The above is table structures.
I need to select values from address & qualification tables and insert the same into employee table by giving id and name values.
Thanks
May 6, 2008 at 4:49 am
[font="Verdana"]I must say, you need to update the Employee table. Tell us which fields of Employee table you wants to update? By the way, how could you have same column name in one table? i.e. in Employee table 3rd and last column.
EMPLOYEE
id
name
pg
street
city
state
pg
please specify more details.
Mahesh[/font]
MH-09-AM-8694
May 6, 2008 at 4:56 am
Hi sharma,
Moreover there is no relationship between Employee table
with Address/Qualification table.
Tell me in which scenario you want the result set?
---
May 6, 2008 at 5:05 am
Sorry the column pg is entered as two times.
This is a scenario
Select the values from both tables and insert into employee table along with id and name.
Any help?
May 6, 2008 at 5:08 am
[font="Verdana"]As the previous poster asked, mention the relation between employee and rest 2 tables.
Mahesh[/font]
MH-09-AM-8694
May 6, 2008 at 10:23 am
Hi Mahesh..
There is no relationship between those tables.
I am doing dumping from two tables into one table.
Migrate data into one table.
The above tbls are sample tbls..
May 6, 2008 at 12:13 pm
If there's no relation between them (something like an employee ID), then there's no way to match the rows from one to the other. Is that what you're saying?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 6, 2008 at 10:11 pm
[font="Verdana"]
sharma (5/6/2008)
Hi Mahesh..There is no relationship between those tables.
I am doing dumping from two tables into one table.
Migrate data into one table.
The above tbls are sample tbls..
Sharma, if there is no any relationship between either the tables, there is no way to do this in right manner. If you will try to update the Employee table without any relation, it will produce Cartesian product and will insert into Employee table.
In that can you need to create relationship between these tables so that your data can migrate well.
Mahesh
[/font]
MH-09-AM-8694
May 6, 2008 at 10:45 pm
Yes GSquared.
For initial data dumping i need to do that way only.
I am having one table. But i need to fetch data from two tables and insert into one table
Thanks
May 6, 2008 at 10:53 pm
Does Employee table have any existing data?
May 6, 2008 at 11:08 pm
Hello Sharma,
there is no unique relationship between employee and two more tables,and then on which scenario can we insert into employee table?
May 7, 2008 at 4:54 am
sharma (5/6/2008)
Yes GSquared.For initial data dumping i need to do that way only.
I am having one table. But i need to fetch data from two tables and insert into one table
Thanks
Not inserting , it should be updating. for update the two table should have relational key with the main table
May 7, 2008 at 7:06 am
No.. Initially Employee tbl does not contain data
May 7, 2008 at 7:46 am
Since there's no relationship in the data, just insert from the first table, then insert from the second table.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 7, 2008 at 8:06 am
sharma (5/6/2008)
Hi i am having three tables (EMPLOYEE,ADDRESS,QUALIFICATION).The below is table structure
EMPLOYEE
id
name
pg
street
city
state
pg
ADDRESSstreet
city
state
QUALIFICATIONug
pg
The above is table structures.
I need to select values from address & qualification tables and insert the same into employee table by giving id and name values.
Thanks
if it is insert then from where you get employee id and name and is your ADDRESS and QUALIFICATION table have data in same order then create one column for id in both table and insert the records in employee table using join
Viewing 15 posts - 1 through 15 (of 23 total)
You must be logged in to reply to this topic. Login to reply