The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
How can this be done ?
Background: One table, articles_article has already been created, with rows having the first column articles_articleid, being the unique id for each row. I want to create another table, articles_newtable with exactly the same number of rows with each row having the same corresponding articles_articleid. How can this be achieved ? Thanks in advance ![]() |
#2
|
||||
|
||||
![]()
that way should work:
[sql] INSERT INTO articles_newtable (articleid) SELECT articles_articleid FROM articles_article[/sql] so you see you can mix up insert an select queries ![]() |
#3
|
||||
|
||||
![]()
I never knew that ! Thanks Stefan
![]() |
#4
|
||||
|
||||
![]()
you're welcome
|
#5
|
||||
|
||||
![]()
A similar technique can be used to copy table contents over within or even between databases.
[sql]create table destinationdatabase.newtable select * from sourcedatabase.oldtable[/sql] You don't have to specificy databases if making a transfer within the same database. |
#6
|
||||
|
||||
![]()
hey, that one was even new to me
![]() you see you can learn more every day.. |
#7
|
||||
|
||||
![]()
This is an enlightening thread
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|