Pytanko o modyfikacje tebaeli w SQL


(m@teo) #1

Mam pytanie, otóż mam 2 tabele users

jedna ma 86 kolumn a druga 102.

gdyż druga tabela była modyfikowana i inaczej wygląda.

Ale działaly obie na tym samym silniku. Chcialbym się dowiedzieć czy da radę poprzez jakieś zapytanie i wklejenie całej struktury tej tabeli 1 która ma 86 kolumn aby tą drugą tak smao przeorbić?

Oto szkielej 1 tabeli:

CREATE TABLE users (

  user_id mediumint(8) NOT NULL default '0',

  user_active tinyint(1) DEFAULT '1',

  username varchar(25) NOT NULL default '',

  user_password varchar(32) NOT NULL default '',

  user_session_time int(11) DEFAULT '0' NOT NULL, 

  user_session_page smallint(5) DEFAULT '0' NOT NULL, 

  user_lastvisit int(11) DEFAULT '0' NOT NULL, 

  user_regdate int(11) DEFAULT '0' NOT NULL, 

  user_level tinyint(1) DEFAULT '0',

  user_posts mediumint(6) UNSIGNED DEFAULT '0' NOT NULL,

  user_timezone decimal(5,2) DEFAULT '0' NOT NULL,

  user_style tinyint(2) default '1' NULL,

  user_lang varchar(12) default '' NOT NULL,

  user_new_privmsg smallint(5) UNSIGNED DEFAULT '0' NOT NULL, 

  user_unread_privmsg smallint(5) UNSIGNED DEFAULT '0' NOT NULL, 

  user_last_privmsg int(11) DEFAULT '0' NOT NULL, 

  user_emailtime int(11) default '0', 

  user_viewemail tinyint(1) DEFAULT '1', 

  user_viewaim tinyint(1) DEFAULT '1', 

  user_attachsig tinyint(1) DEFAULT '1', 

  user_allowhtml tinyint(1) DEFAULT '1', 

  user_allowbbcode tinyint(1) DEFAULT '1', 

  user_allowsmile tinyint(1) DEFAULT '1', 

  user_allowavatar tinyint(1) DEFAULT '1' NOT NULL, 

  user_allowsig tinyint(1) DEFAULT '1' NOT NULL,

  user_allow_pm tinyint(1) DEFAULT '1' NOT NULL, 

  user_allow_viewonline tinyint(1) DEFAULT '1' NOT NULL, 

  user_notify tinyint(1) DEFAULT '1' NOT NULL,

  user_notify_pm tinyint(1) DEFAULT '1' NOT NULL, 

  user_popup_pm tinyint(1) DEFAULT '0' NOT NULL,

  user_rank int(11) DEFAULT '0',

  user_avatar varchar(100) default '',

  user_avatar_type tinyint(1) DEFAULT '0' NOT NULL, 

  user_email varchar(255) default '',

  user_icq varchar(15) default '',

  user_website varchar(255) default '',

  user_from varchar(64) default '',

  user_sig text,

  user_sig_bbcode_uid char(10) default '',

  user_sig_image varchar(100) NOT NULL DEFAULT '',

  user_aim varchar(255) default '',

  user_yim varchar(255) default '',

  user_msnm varchar(255) default '',

  user_occ varchar(100) default '',

  user_interests varchar(255) default '',

  user_actkey varchar(32) default '',

  user_newpasswd varchar(32) default '',

  user_birthday int(6) DEFAULT '999999' NOT NULL,

  user_next_birthday_greeting int(4) DEFAULT '0' NOT NULL,

  user_custom_rank varchar(100) default '',

  user_photo varchar(100) default '',

  user_photo_type tinyint(1) DEFAULT '0' NOT NULL,

  user_custom_color varchar(6) default '',

  user_badlogin smallint(2) DEFAULT '0' NOT NULL,

  user_blocktime int(11) DEFAULT '0' NOT NULL,

  user_block_by char(8) default '',

  disallow_forums varchar(254) default '',

  can_custom_ranks tinyint(1) DEFAULT '1' NOT NULL,

  can_custom_color tinyint(1) DEFAULT '1' NOT NULL,

  user_gender tinyint(1) NOT NULL DEFAULT '0',

  can_topic_color tinyint(1) DEFAULT '1' NOT NULL,

  user_notify_gg tinyint(1) DEFAULT '0' NOT NULL,

  allowpm tinyint(1) DEFAULT '1',

  no_report_popup tinyint(1) DEFAULT '0' NOT NULL,

  refresh_report_popup tinyint(1) DEFAULT '0' NOT NULL,

  no_report_mail tinyint(1) DEFAULT '0' NOT NULL,

  user_avatar_width smallint(3) default NULL,

  user_avatar_height smallint(3) default NULL,

  special_rank mediumint(8) UNSIGNED DEFAULT NULL,

  user_allow_helped tinyint(1) UNSIGNED NOT NULL DEFAULT '1',

  user_ip char(8) DEFAULT NULL,

  user_ip_login_check tinyint(1) DEFAULT '1' NOT NULL,

  user_spend_time int(8) DEFAULT '0' NOT NULL,

  user_visit int(7) DEFAULT '0' NOT NULL,

  user_session_start int(11) NOT NULL DEFAULT '0',

  read_tracking_last_update int(11) NOT NULL DEFAULT '0',

  user_jr tinyint(1) DEFAULT '0',

  PRIMARY KEY (user_id), 

  KEY user_session_time (user_session_time),

  KEY user_level (user_level),

  KEY user_lastvisit (user_lastvisit),

  KEY user_active (user_active)

);

czy będzie coś takiego jak np. MODYFIED TABLE i dalej ten szkielet? :slight_smile:


(Krzkaczor) #2

np. możesz np. zmodyfikować pola tabeli tak żeby pasowało do tej 2 i wtedy importowanie.


(m@teo) #3

no własnie to chce zorbić tylko w jaki sposób?