SQL Tutorial - 13: Inserting Data Into a Table From Another Table

preview_player
Показать описание
In this tutorial we'll learn to use the INSERT Query to copy data from one table into another.
Рекомендации по теме
Комментарии
Автор

hours trying to do this because the info given by my teacher says to use VALUE before the select sentence, now I tried without it and it worked perfectly, I am frustrated by the faults in my info but also thankful you helped me fix it, finally.

tick_tack
Автор

Is it possible to use this INSERT command to add a computed column from table 1 (source) to destination? My syntex (shown below) works for calculating running total however, it doesn't work if i try to use same query to insert running total to new table;


select t_date, amount,
sum(amount) over (order by t_date) as balance
from bank
order by t_date;

If i add one additional line as your video "INSERT INTO new_tb (t_date, amount, balance), the balance column in new_tb is still zero.

Any input would be highly appreciated.

mannyparmar
Автор

hi @Simplified do you have a video for how to populate new tables from 2 tables 1 new table that regroups some of the 2 tables column ( exemple table clients, table invoices populating Clients invoices)
regrouping all invoice from each clients)?

Defense
Автор

Sir what if i only want to get specific data from two different table like for example in table one i only want to pull the column1 and column and the same time in table two i want to pull column 1, column3 and columnn 5 and insert it to table three.

jomelcadiente
Автор

How did you make the emp_info table? In which video? Because when I make it, it shows yes under null value infront of integer. Please help?

ScenicWinds
Автор

It's pulling data from source table to an empty table. Actually is it simpler to create a new table with new column names? If the table is not empty, I want to add a column to pull data from any table's column, I don't want those data to be after the origin null value, how to make it happen?

dingjoyce
Автор

thank you so much. You have saved me from a lot of stress.

tendongzegodson
Автор

How do i copy a particular column values from one table to a column in an empty table?

Achinta-lkex
Автор

Can this method be used like a draft table scenario?

So, the insert query copies the data over to the live table with the first table taking the data as the 'draft table'?

drkraw
Автор

What if i don't know the columns present in the other table but I want all the data to place into another table? can you tell me the command

chundurusriharsha
Автор

sir I want to copy data from one table to another only if a condition satifies...how to do that? please reply

solastametanoia
Автор

Is the data insert in another table remains in table from which it is inserted

jitendramishra
Автор

can we the move the data of different table structure in same database

shaikkhadarvali
Автор

Just brilliant and very clear explanation... thank you very much sir and I just hit the subscribe button and the bell icon... you added me as a new subscriber

dinushkamahawedage
Автор

Save my week. Now I need to do that in Node.js Thanks

bobich
Автор

I'm using Access2013 the SQL you provided at 1:05 did not work.

martyinsumatra
Автор

I have a question sir what if i have a 5 records into tb1 and i want to insert only one row into tb2

gefiedelacruz
Автор

Wil it move data or it copies from one table to another

qaziabaan
Автор

Great!!!

thanks a lot!!!!

it's working on me..
i make my website project and you help me a lot..

arixalasian
Автор

Thanks, this is easy to copy from one file to other. (For having backup)

kshitizsharma