我在分配作业时遇到麻烦,任何人都可以帮我吗
我需要怎么做才能解决此问题,我不断收到#1062错误消息
-- phpMyAdmin SQL Dump
-- version 4.2.9.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: March 04, 2015 at 15:00
-- Server version: 5.6.22-log
-- PHP Version: 5.5.15-pl0-gentoo
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `mydb1931`
--
-- --------------------------------------------------------
--
-- Table structure for table `Present Cast`
--
CREATE TABLE IF NOT EXISTS `Present Cast` (
`Character` varchar(100),
`Actor(s)` varchar(100),
`Duration` varchar(100)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `Present Cast`
--
INSERT INTO `Present Cast` (`Character`, `Actor(s)`, `Duration`) VALUES
('Tony Hutchinson', 'Nick Pickard', '1995-'),
('Cindy Cunningham', 'Stephanie Waring', '1995-2001, 2002'),
(NULL, 'Laura Crossley', '2004, 2008-'),
('Jack Osborne', 'Jimmy McKenna', '1996-'),
('Darren Osborne', 'Ashley Taylor Dawson', '1996-97, 1999-2000'),
(NULL, 'Adam Booth', '2003-'),
('Holly Cunningham', 'Amanda Clapham', '1997-2001'),
(NULL, 'Wallis Day', '2002, 2004'),
(NULL, 'Lydia Waters', '2008-10'),
(NULL, 'Karis Sharkey', '2012-'),
('Tom Cunningham', 'Ellis Hollins', '1999-'),
('Frankie Osborne', 'Helena Pearson', '2002-'),
('Nancy Hayton', 'Jessica Fox', '2006-'),
('Ste Hay', 'Kieron Richardson', '2006-'),
('Mercedes McQueen', ' Jennifer Metcalfe', '2006-'),
('Myra McQueen', 'Nicole Barber-Lane', '2006-'),
('John Paul McQueen', 'James Sutton', '2006-08, 2012-'),
('Charlie Dean', 'Charlie Beham', '2006-'),
(NULL, 'Joshua McConville', NULL),
('Leah Barnes', 'Ela-May Dermican', Null),
(NULL, 'Jessica Croft-Lane', '2007-'),
(NULL, 'Magic Hurst', NULL),
('Nana McQueen', 'Diane Langton', '2007-09, 2012-'),
('Harry Thompson', 'Parry Glasspool', NULL),
(NULL, 'Harrison George Rhodes','2007-09, 2015-'),
(NULL, 'Daniel Seymour', NULL),
('Theresa McQueen', 'Jorgie Porter', '2008-'),
('Lucas Hay', 'William Hall', NULL),
(NULL, 'Reuben Thwaites', '2009-'),
(NULL, 'Jude Hawley', NULL),
('Sinead O Connor', 'Stephanie Davis', '2010-'),
('Diane O Connor', 'Alex Fletcher', '2010-'),
('Esther Bloom', 'Jazmine Franks', '2011-'),
('Dirk Savage', 'David Kennedy', '2011-'),
('Phoebe McQueen', 'Mandip Gill', '2012-'),
('Maxine Minniver', 'Nikki Sanderson', '2012-'),
('Sienna Blake', 'Anna Passey', '2012-'),
('Patrick Blake', 'Jeremy Sheffield', '2012-'),
('Robbie Roscoe', 'Charlie Wernham', '2013-'),
('Trevor Royle', 'Greg Wood', '2013-'),
('Freddie Roscoe', 'Charlie Clapham', '2013-'),
('Jason Roscoe', 'Alfi Browne-Sykes', '2013-'),
('Joe Roscoe', 'Ayden Callaghan', '2013-'),
('Ziggy Roscoe', 'Fabrizio Santino', '2013-'),
('Lindsey Butterfield', 'Sophie Austin', '2013-'),
('Peri Lomax', ' Ruby O Donnell', '2013-'),
('Tegan Lomax', 'Jessica Ellis', '2013-'),
('Leela Lomax', 'Kirsty-Leigh Port', '2013-'),
('Grace Black', 'Tamara Wall', '2013-'),
('Nico Blake', 'Persephone Swales-Dawson', '2014-'),
('Cameron Campbell', 'Cameron Moore', '2014-'),
('Kim Butterfield', 'Daisy Wood-Davis', '2014-'),
('Dr. Charles Savage', 'Andrew David Grennough', '2014-'),
('Lockie camobell', 'Nick Rhys', '2014-'),
('Porsche McQueen', 'Twinnie Lee Moore', '2014-'),
('Celine McQueen', 'Sarah George', '2014-'),
('Dylan Jenkins', 'James Fletcher', '2015-'),
('Cleo McQueen', 'Nadine Mulkerrin', '2015-');
-- --------------------------------------------------------
--
-- Indexes for table `Present Cast`
--
ALTER TABLE `Present Cast`
ADD PRIMARY KEY (`Character`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
我不断收到一条错误消息,内容为
#1062 - Duplicate entry '' for key 'PRIMARY'
感谢任何帮助的人:)
最佳答案
字符列值至少在两行中使用NULL,并将表的主键设置为字符列。
根据定义,如果列是主键,则该列的值对于所有行都必须是唯一的。
要解决此问题,您需要为每行设置一个唯一的Character值,而该行的Character列值目前为NULL值。
关于mysql - phpMyAdmin#1062-键'PRIMARY'的重复条目'',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29450124/