Hello, in this video we are going to cover clone in, you know, like a duplicate in a table. Sorry about that a little bit of a cough. I've got this users table with some data and I just want to duplicate it. So to do that, we can let's do a query. You just prepare the query as you normally would with any other you. And we are going to put here, create and table.
Then we specify the table name. So this is the new table that we want to basically what you do you say, I'm creating a new table, and I want it to be in the same structure as my previous table. So this is the new table with a new user. And then you say like, Cool users? Yes. So run the query and execute.
And I know I can't execute one. There we go. If I reload that no arrows go here. We've got four we know the entire page. You'll see there we go new users. And but but yes, it will duplicate it.
And I turn the primary keys, the datatype, the field, all that, but you will not actually transfer over the, what's it called the data. To do that you need a separate query. And yes, you could do all of this in one go, but I wanted to demonstrate it separately. So you will need to know a query for this. And this is going to say connection. Again, let's compare it as you normally would.
And in here, you say insert so you're using a modified insert to insert into new users. So the new table that's been created everything from users. And that's in the case to saying, Get everything from here and then put it in to Yeah. So we say that go back we know again era, so means something gone wrong. Okay? So saying insert into new user.
Now, miss the key word, you need to select it. So you may say insert, insert into here, everything that we get from user so we're actually combining select Add an insert query here as well as missed out a keyword There we go. Click Browse, and all the data is that didn't have much data in there in the first place. But that is how you clone aka duplicate tables. Very simple stuff, but really useful. If you have any questions, feel free to pop me a message and as usual, I look forward to seeing In the next video