MySQL Database Tutorial - 27 - How to Insert Multiple Rows

MySQL Database Tutorial - 27 - How to Insert Multiple Rows

thenewboston

12 лет назад

137,312 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

EricShoots
EricShoots - 06.04.2022 07:39

Question: can't we just combine two tables with a JOIN statement?

Ответить
Ari Gusti Satria
Ari Gusti Satria - 08.08.2020 08:28

How to use FOR statement?

Ответить
tapesh vashisth
tapesh vashisth - 22.07.2020 21:26

550th like😁😁😁😁😁😁😁

Ответить
Roberto Gutbrown
Roberto Gutbrown - 12.05.2020 08:25

THANK! LIKE IF YOU ARE IN THE FUTURE!

Ответить
Ibrehima Keita
Ibrehima Keita - 04.10.2019 02:52

Hey you are awesome

Ответить
Neeloj P
Neeloj P - 23.05.2019 11:11

very useful trick :-), thanks

Ответить
Fynn
Fynn - 18.02.2019 20:41

i want to know how to insert a data in two relation tables using textbox( window form) in c#

Ответить
kingkakig
kingkakig - 24.12.2017 22:29

Ok then what about inserting a row in between to sequential ids? I would like to renumber the last ids, in other words bump them up. For example I have ids 1,2,3 and want to add a row in between 1 and 2? How would that be possible?

Ответить
bitofgrace
bitofgrace - 15.09.2017 20:59

Awesome!!

Ответить
AJay Gupta
AJay Gupta - 26.06.2017 20:02

Love you Bucky!!

Ответить
Anthony Oboney
Anthony Oboney - 08.06.2017 23:44

thanks Bucky,
how do i use the 'WHERE' clause in the insert, select statement

Ответить
nayan panday
nayan panday - 10.05.2017 16:29

i need to insert sub columns .. how ??

Ответить
Evgeni Kuzmov
Evgeni Kuzmov - 14.03.2017 10:54

how do you merge it then ? 😃

Ответить
scorpiomaj27
scorpiomaj27 - 09.01.2017 23:33

This might sound silly, but an Oracle mentor of mine advised me that to properly avoid at the comma problem, you should always BEGIN with the comma on each new line. Good habits can prevent many errors.

Ответить
zhang Jeffrey
zhang Jeffrey - 01.09.2016 03:01

How to insert a row into row #1? I mean not append a row at last.

Ответить
Marcia Allen
Marcia Allen - 08.08.2016 01:00

Thanks again Bucky for great tutorials!

Ответить
deadeyesox
deadeyesox - 01.07.2016 12:59

what happens if the faketable has the same id number with the items?

Ответить
deadeyesox
deadeyesox - 01.07.2016 12:41

I want to bid for beef chops!

Ответить
just_jimmy
just_jimmy - 29.05.2016 17:12

nada

Ответить
Thin Soldier
Thin Soldier - 12.03.2016 06:36

I've had lots of good reasons to insert data via selecting from another table. It is not a "bad practice". Having unnecessarily duplicate data is bad but that is a concern separate from using this technique.

Example: There is a client with 2 apps with 2 separate databases. 1 is ancient and gigantic and contains 15 years worth of info from 6 businesses. Employees update that database via a desktop program that only runs in windows 95 and its original developers are all dead. The other database is small and fast and properly normalized and powers both a website and mobile app that sells a tiny fraction of things from 1 of the businesses. Rather than have employees add items via the desktop app and then repeat that work to add the items to the smaller website, we select the data from the older database and by using aliases in our SELECT statements we create result sets that exactly match the table structures in the newer database and we copy only the relevant data into the new site.

Ответить
TortoiseDash
TortoiseDash - 14.08.2015 21:10

"send me a million dollars" lol

Ответить
Devon Horner
Devon Horner - 07.08.2015 21:45

Technically NULL means unknown, which is different from an empty string.

Ответить
真中合歓
真中合歓 - 19.05.2014 17:49

nice,It's easy to understand.I want to konw where can i watch your video of C++

Ответить
L Urbanski
L Urbanski - 12.04.2014 10:55

Question for SQL specialists : Why can't i use function NVL to replace null by random number?

Ответить
Soyun Yoon
Soyun Yoon - 04.08.2013 10:50

anti vegetarian episode -_-

Ответить
Jason Melo Hall
Jason Melo Hall - 11.07.2013 01:03

jelly pockets and sack of ham

Ответить
licemeat
licemeat - 22.06.2013 20:46

i would like to buy a babyfoot.

Ответить
movie627
movie627 - 12.06.2013 16:04

Come on,baby no emmy no emmy

Ответить
Mmmh
Mmmh - 17.02.2013 01:11

it was not set as autoincrement, but it was a primiary key nonetheless, so it must have been not null

Ответить
Mmmh
Mmmh - 17.02.2013 01:09

they still have to be uniqe, you can type INSERT INTO items(id,name) SELECT id+106,name FROM customers Now ids will be uniqe. How's your career after 11months? Are you working with SQL maybe? :D

Ответить
Ashel Vas
Ashel Vas - 09.02.2013 18:20

Bucky<3 You save lives! Thank you so much :)

Ответить
清水ケビン
清水ケビン - 26.01.2013 20:16

LoL this was upload on my birthday last year XD

Ответить
Tutorials Guy
Tutorials Guy - 28.11.2012 18:26

You can just leave the id (first field) empty while entering values, since I guess it is an autoincrement field.

Ответить
nipuni malsara
nipuni malsara - 08.10.2012 21:52

thank u

Ответить
Herp Derpingson
Herp Derpingson - 31.08.2012 15:07

Agreed but this is good for school shit.

Ответить
Ashish Sood
Ashish Sood - 07.08.2012 16:26

Thanks very knowledgeable

Ответить
ChrisPTY507 - No Commentary Gaming
ChrisPTY507 - No Commentary Gaming - 08.07.2012 23:29

So i a few words,im not gonna make lot of money by just being a database admin,and i need several months to be tested?

Ответить
ChrisPTY507 - No Commentary Gaming
ChrisPTY507 - No Commentary Gaming - 08.07.2012 22:43

I dont understand your comment at all.....

Ответить
ChrisPTY507 - No Commentary Gaming
ChrisPTY507 - No Commentary Gaming - 01.07.2012 07:41

If i work in a company as a database administrator,am i gonna make good amount of money by doing that...?? what kind of stuff companies make ya do if ur a database admin?

Ответить
Simon Wanner
Simon Wanner - 02.05.2012 00:53

Expensive baby seat!

Ответить
myVideos
myVideos - 07.03.2012 23:53

WHATS WITH THE sql rule THAT ONE ROW MUST HAVE A UNIQUE VALUE(key), BUT IF YOU COPY id FROM ANOTHER TABLE YOU WILL HAVE THE SAME ID FOR MULTIPLES ITEMS ?????

Ответить
XYZ
XYZ - 25.01.2012 20:43

* sneakily doesn't send him a million dollars*

Ответить