|
|
#1 (permalink) |
|
Moo indeed.
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
|
MySQL - Create Copy of a Table
Hey there PC tech talkers,
MySQL query: I would like 2 tables with the same fields and field types etc. and have created one already with the required field names and properties, but was lazy and did it through the MySQL admin software and am looking for an easy way to simply 'copy' and 'paste' these fields into another table. Anyone know how I could do this? Your knowledge would be a lot of my time saved. ![]() Thanx in advance, KC (O, btw When I say 'fields' I would prefer to NOT be copying table data (ie. data entries in the table) across as well, I just want the field names and field properties etc.)
__________________
|
|
|
|
|
|
#2 (permalink) |
|
News Writer!
Join Date: Nov 2002
Location: United Kingdom
Posts: 785
|
not sure if this will be of interested but for all my mysql databases i use a little util called phpMyAdmin. Much nicer interface than the MySQL console and easier to navigate
![]() www.phpmyadmin.net
__________________
![]() "The hardest thing in this world is to live in it." |
|
|
|
|
|
#3 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
if you have the table already
insert into copy_table select * from orig_table; if you don't have the table yet: select * from orig_table into copy_table; ohw and... console rawwwwwwwwwwwwks
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#4 (permalink) | |
|
Moo indeed.
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
|
Hey gref,
Quote:
Any more powerful recommendations? What type of database does this forum use btw?The project Im currently undertaking requires a database that will handle 'complicated' requests, that will need to be processed quickly, such as string and numerical searchs through over 1000 sets of data in seconds and also popping them out in chronological order etc. MySQL has alrady shown me some strengths and weaknesses, I currently mostly use PHP to filter out and order search results by retrieving all valid/unexpired entries and then use PHP if statements to stop entries that dont meet filter criteria from there on in till the printed result... any recommendations? Cheers for your help so far, and yeh consol is good if you dont feel lazy like i do most days. ![]() KC
__________________
|
|
|
|
|
|
|
#5 (permalink) |
|
Moo indeed.
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
|
Ammendment to greffov's 'select * from orig_table into copy_table;' for new tables....
That didn't work properly.... ![]() But found the solution ![]() Here it is: CREATE TABLE new_table_name SELECT * FROM original_table;
__________________
|
|
|
|
|
|
#6 (permalink) |
|
Da House Nerd
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
|
ohw, sorry, on the one database that works, on the other the other... it all does the same, but the syntax is quite different...
__________________
Linux virusscanner detected a virus: Windows 95 ... delete [Y/n] y ~ ~ :wq |
|
|
|
|
|
#7 (permalink) |
|
Registered User
Join Date: Oct 2008
Posts: 14
|
I fully support you, this is my task. I hope you better:Shanghai massage|Shanghai escort|massage Shanghai|massage in Shanghai
|
|
|
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Nov 2008
Posts: 77
|
I agree with you!!!
I like your article!!!The article very interesting.------------------------------------------------------------------------------------------------------------------------------Welcome to our wow power leveling site:Cheapest Maple Story Mesos,Cheap WARHAMMER ONLINE GOLD for sale,RuneScape Money,buy SilkRoad Online Gold,buy Gaia Gold.LWB
|
|
|
|
|
|
#9 (permalink) |
|
Registered User
Join Date: Dec 2008
Posts: 10
|
你想多有玩三年的时间吗
经北京市财政局批准,工商注册登记成立的信息公司。公司成立起点高,专业性强,现有员工中具会计师及以上职 称的8人,教授级顾问3人,专业咨询人员18人。专门从事财务代理、税务代理、财税咨询和工商代理等业务的 专业机构。 业务范围 本公司本着为贵单位合理合法 , 节省经营成本和开支的 , 在诚信保密的基础上 , 专业的理财。发票|北京?l票|北京开发票|建筑发票|广告发票|13521714999|北京?l票代开|代开广告发票|代开北京?l票|代开建筑发票|工程发票:建筑发票、北京?l票,广告发票、广告发票、建筑工程发票、咨询发票、酒店发票,会议发票、房屋租赁发票、租赁发票、建筑发票、 建筑公司,北京建筑公司,北京建筑工程公司,广告公司,北京广告公司,咨询公司,北京咨询公司、餐饮发票、 技术发票、国税发票、地税发票、商业发票,普通发票,工业企业发票;装修发票,广告发票;北京?l票服务中心。
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|