-
5th May 2010, 09:14 PM
#11
Senior Member
Diamond Hubber
Is any one familiar with the hardest thing in SQL code, known as Cursor?
I will explain what I need to do..
I have table A , and Table B
Table A Table B
--------- ------------
First_name First_name
Last_name Last_name
Address1 Address1
Adreess2 Address2
What I want to do, see if the firstname and last_name in Table B exist in Table A, if so then I want to update Address1 and address2 in table A with a value. This is easy to do for couple of rows.
using
Update Table A
set address1='test',
address2='test2'
where first_name in (select first_name from table B
where first_name like 'Super')
but the problem is in Table B , i have 10,000 first_name with values in the address1.. I need update table A9Address1) with a value based on table B's contact name, hence you end up with 10,,000 different names, with 10,000 different address, if it was just one addreess it would have been very easy, I can use the above script.
any ideas any one ?
Om Namaste astu Bhagavan Vishveshvaraya Mahadevaya Triambakaya Tripurantakaya Trikalagni kalaya kalagnirudraya Neelakanthaya Mrutyunjayaya Sarveshvaraya Sadashivaya Shriman Mahadevaya Namah Om Namah Shivaye Om Om Namah Shivaye Om Om Namah Shivaye
-
5th May 2010 09:14 PM
# ADS
Circuit advertisement
Bookmarks