On Thu, 2003-10-16 at 17:42, Jeff McKeon wrote:
> Is there a way to generate a "line number" for a query return within the
> returned rows??
> 
> For instance, if I return 5 rows from a query, is there a command or
> function I can put in a query to add a column that contains the row
> number returned?
> 
> Select some_command(),blah, blew from table where blah > 1;
> 
> +-----------+-----------+-----------+
> | row         | blah  | blew  | 
> +-----------+-----------+-----------+
> | 1           | blah  | blew  | 
> | 2           | blah  | blew  | 
> | 3           | blah  | blew  | 
> | 4           | blah  | blew  | 
> +-----------+-----------+-----------+

You can do:

SELECT @a:=0;
SELECT @a:[EMAIL PROTECTED], blah, blew from table where blah > 1;


-- 
Diana Soares


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to