简体   繁体   中英

SQL-How to insert one value from one table to another but the data in another table should remain the same

I have two simple tables:

  • bazaa (ime VARCHAR(20),prezime VARCHAR(20))
  • bazab (ime VARCHAR(20),prezime VARCHAR(20))

Let's say bazaa contains 1 ime and 1 prezime and bazab contains 2 ime and 2 prezime.

I want to insert values into bazaa and those values should also be inserted into bazab but it shouldn't delete anything or mess up the positions of rows.

I tried with some triggers from answers on other questions but it doesn't work.

Any help would be much appreciated. Thanks.

尝试这个

Insert into bazab select * from bazaa;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM