On 5 Jun 2002, at 22:03, Marco Stagno wrote:
> and if I delete the 'dog' record...
>
> +-------------+-------+
> | example | pos |
> +-------------+-------+
> | cat | 1 |
> | horse | 2 |
> .... ...
>
> IMPORTANT NOTE: I can't add a (permanent) column with an
> "auto_increment" value; I'm writing a simple gui for mysql and I don't
> want to alter the original db..
It's not clear from your description whether the numbers are
associated with the records in the table or with the records returned
by the select query, but it sounds like this might be something you
should be handling in whatever you're using to write the GUI, not in
MySQL itself. I suppose you could do something like
SET @i = 0;
SELECT animal, @i = @i + 1 AS pos FROM animals;
--
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org
---------------------------------------------------------------------
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