alter table your_table add unique index (path_id,word) ; -----Message d'origine----- De : Jon Shoberg [mailto:[EMAIL PROTECTED]] Envoyé : mardi 5 février 2002 16:40 À : [EMAIL PROTECTED] Objet : Spam Filtered - Re: Making Unique Pairs ??
HUH ? Oh well lets try again, please read below ... SQL = SELECT help FROM mysql.list WHERE spam NOT LIKE 'bounce%' > Your message cannot be posted because it appears to be either spam or > simply off topic to our filter. To bypass the filter you must include > one of the following words in your message: > > sql,query > > If you just reply to this message, and include the entire text of it in the > reply, your reply will go through. However, you should > first review the text of the message to make sure it has something to do > with MySQL. Just typing the word MySQL once will be sufficient, for example. > > You have written the following: > > I have a table such as > > ID path_id word > > ID is the primary key unqigned int > path_id is a foreign key unsigned int > word is a single word of text varchar (32) > > How can I set up the table such that all -pairs- of PATH_ID and WORD are > unique? > > The table should look like the following > > 1 2 jim > 2 3 tom > 3 2 joe > 4 7 jack > > but if I try an insert '2' and 'jim' again, the statement fails. > > > Any thoughts? > > > > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php