List:General Discussion« Previous MessageNext Message »
From:Jasper Bryant-Greene Date:August 29 2005 8:45am
Subject:Re: Mark a single row?
View as plain text  
lists.mysql-users@stripped wrote:
> Hallo,
> 
> I would like a single row in a table, and not more than one, to be
> used as a preferred value in another application.
> Is this possible, and, if yes, how?

add a column 'preferred', tinyint(1) NOT NULL.

To change the preferred value:

START TRANSACTION
UPDATE table SET preferred=0
UPDATE table SET preferred=1 WHERE column_id=1234
COMMIT

-- 
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s
Thread
Mark a single row?lists.mysql-users29 Aug
  • Re: Mark a single row?Jasper Bryant-Greene29 Aug
Re: Mark a single row?lists.mysql-users29 Aug
  • Re: Mark a single row?Michael Stassen29 Aug
Re: Mark a single row?lists.mysql-users29 Aug