| |

VerySource

 Forgot password?
 Register
Search
View: 17|Reply: 2

Please see how to solve this problem in the stored procedure. Thank you

[Copy link]

1

Threads

2

Posts

3

Credits

Newbie

Rank: 1

Credits
3

 China

Post time: 2020-2-21 13:30:01
| Show all posts |Read mode
Example: A record already exists in table a1:
a b c d e
-----------------------------
Haikou Hainan Province China 20

Then the a1 table and the b1 table are associated to take out the following data
a b c d e
---------------------------------------
Haikou, Hainan Province, China 20 5 (d / f, (f is the result of table b1))
Haikou, Hainan, China 20 0.67 (d / f, (f is the result of table b1))

Requirement: How can the data obtained from tables a1 and b1 overwrite existing records in table a1, and how to append another record to table a1

Thank you!
Reply

Use magic Report

0

Threads

8

Posts

7

Credits

Newbie

Rank: 1

Credits
7

 Invalid IP Address

Post time: 2020-5-1 09:00:02
| Show all posts
insert into a1 as
select .......
minus
select ...... a1 ....

or
insert into a1 select ......
where not exist (select .... from a1 ....)
Reply

Use magic Report

1

Threads

2

Posts

3

Credits

Newbie

Rank: 1

Credits
3

 China

 Author| Post time: 2020-5-3 10:30:01
| Show all posts
Can the upstairs write the code clearly? I can't understand
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2020|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list