September 14, 2011 at 12:17 pm
Can anybody help me in insert statement:
I have a table say table 1 which has many columns but out of these one column say Tid is null and all other columns has records in it.
I do have another table2 which has column pid.
I am trying to get the records from column pid table2 and insert it into Tid in table1
. How can i do it?
Urgent please help me out...
Thanks..
September 14, 2011 at 2:40 pm
Beginner_2008 (9/14/2011)
Can anybody help me in insert statement:I have a table say table 1 which has many columns but out of these one column say Tid is null and all other columns has records in it.
I do have another table2 which has column pid.
I am trying to get the records from column pid table2 and insert it into Tid in table1
. How can i do it?
Urgent please help me out...
Thanks..
Awful thin on the details...
you have to be able to establish some sort of relationship between the two tables. without that information, it's a crapshoot.
syntax wise, it goes something like this: i took a lot of liberties ont eh assumptions.
UPDATE TABLE1
SET TABLE1.PID = TABLE2.TID
FROM TABLE2
WHERE TABLE1.CONTACTTBLKEY=TABLE2.CONTACTTBLKEY
AND TABLE1.PID IS NULL
AND TABLE2.TID IS NOT NULL
AND STATE = 'FL'
Lowell
September 14, 2011 at 2:50 pm
Thanks,
I used export and import wizard . but it was urgent in the time..
February 17, 2012 at 8:44 am
Thanks for the information.
February 17, 2012 at 8:50 am
CELKO (9/15/2011)
...Rows are not records; records are not values it is a HUGE difference that you will nee to learn. Please post DDL and not a vague, useless narration (can you program from this??!! Me neither.).
My guess is that you want a MERGE statement ...
I call rows - records, and genuinely believe that records can contain values. I don't see ANY difference and i have no urge to learn it.:-P
Questions better to be posted with accordance to forum etiquette which you can read about if you click the link at the bottom of my signature.
So my guess is:
Follow the above advise and you will get relevant help!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply