MySQL Forums
Forum List  »  Newbie

Re: Combining several queries from Wordpress Database
Posted by: Matthew Steele
Date: December 29, 2014 09:10AM

Thanks very much for your help on this Rick.

I get this error: Not unique table/alias: 'fn'

I have tried to Google this problem and look for the error but I couldn't.

Here is the SHOW CREATE TABLE for each table:

wp_wp_pro_quiz_statistic:

CREATE TABLE `wp_wp_pro_quiz_statistic` (
 `statistic_ref_id` int(10) unsigned NOT NULL,
 `question_id` int(11) NOT NULL,
 `correct_count` int(10) unsigned NOT NULL,
 `incorrect_count` int(10) unsigned NOT NULL,
 `hint_count` int(10) unsigned NOT NULL,
 `solved_count` tinyint(1) NOT NULL,
 `points` int(10) unsigned NOT NULL,
 `question_time` int(10) unsigned NOT NULL,
 `answer_data` text,
 PRIMARY KEY (`statistic_ref_id`,`question_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

wp_wp_pro_quiz_statistic_ref:

CREATE TABLE `wp_wp_pro_quiz_statistic_ref` (
 `statistic_ref_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `quiz_id` int(11) NOT NULL,
 `user_id` bigint(20) unsigned NOT NULL,
 `create_time` int(11) NOT NULL,
 `is_old` tinyint(1) unsigned NOT NULL,
 `form_data` text,
 PRIMARY KEY (`statistic_ref_id`),
 KEY `quiz_id` (`quiz_id`,`user_id`),
 KEY `time` (`create_time`)
) ENGINE=InnoDB AUTO_INCREMENT=882 DEFAULT CHARSET=utf8

wp_wp_pro_quiz_master:

CREATE TABLE `wp_wp_pro_quiz_master` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(200) NOT NULL,
 `text` text NOT NULL,
 `result_text` text NOT NULL,
 `result_grade_enabled` tinyint(1) NOT NULL,
 `title_hidden` tinyint(1) NOT NULL,
 `btn_restart_quiz_hidden` tinyint(1) NOT NULL,
 `btn_view_question_hidden` tinyint(1) NOT NULL,
 `question_random` tinyint(1) NOT NULL,
 `answer_random` tinyint(1) NOT NULL,
 `time_limit` int(11) NOT NULL,
 `statistics_on` tinyint(1) NOT NULL,
 `statistics_ip_lock` int(10) unsigned NOT NULL,
 `show_points` tinyint(1) NOT NULL,
 `quiz_run_once` tinyint(1) NOT NULL,
 `quiz_run_once_type` tinyint(4) NOT NULL,
 `quiz_run_once_cookie` tinyint(1) NOT NULL,
 `quiz_run_once_time` int(10) unsigned NOT NULL,
 `numbered_answer` tinyint(1) NOT NULL,
 `hide_answer_message_box` tinyint(1) NOT NULL,
 `disabled_answer_mark` tinyint(1) NOT NULL,
 `show_max_question` tinyint(1) NOT NULL,
 `show_max_question_value` int(10) unsigned NOT NULL,
 `show_max_question_percent` tinyint(1) NOT NULL,
 `toplist_activated` tinyint(1) NOT NULL,
 `toplist_data` text NOT NULL,
 `show_average_result` tinyint(1) NOT NULL,
 `prerequisite` tinyint(1) NOT NULL,
 `quiz_modus` tinyint(3) unsigned NOT NULL,
 `show_review_question` tinyint(1) NOT NULL,
 `quiz_summary_hide` tinyint(1) NOT NULL,
 `skip_question_disabled` tinyint(1) NOT NULL,
 `email_notification` tinyint(3) unsigned NOT NULL,
 `user_email_notification` tinyint(1) unsigned NOT NULL,
 `show_category_score` tinyint(1) unsigned NOT NULL,
 `hide_result_correct_question` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `hide_result_quiz_time` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `hide_result_points` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `autostart` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `forcing_question_solve` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `hide_question_position_overview` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `hide_question_numbering` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `form_activated` tinyint(1) unsigned NOT NULL,
 `form_show_position` tinyint(3) unsigned NOT NULL,
 `start_only_registered_user` tinyint(1) unsigned NOT NULL,
 `questions_per_page` tinyint(3) unsigned NOT NULL,
 `sort_categories` tinyint(1) unsigned NOT NULL,
 `show_category` tinyint(1) unsigned NOT NULL,
 `category_id` int(10) unsigned NOT NULL,
 `admin_email` text NOT NULL,
 `user_email` text NOT NULL,
 `plugin_container` text,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8

wp_usermeta:

CREATE TABLE `wp_usermeta` (
 `umeta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `user_id` bigint(20) unsigned NOT NULL DEFAULT '0',
 `meta_key` varchar(255) DEFAULT NULL,
 `meta_value` longtext,
 PRIMARY KEY (`umeta_id`),
 KEY `user_id` (`user_id`),
 KEY `meta_key` (`meta_key`)
) ENGINE=MyISAM AUTO_INCREMENT=9280 DEFAULT CHARSET=utf8

Again, thank you very much!

Options: ReplyQuote


Subject
Written By
Posted
Re: Combining several queries from Wordpress Database
December 29, 2014 09:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.