I think it is: SET @a:=0; /* SELECT would return the value. Of course it would work but .... */ SELECT @a:[EMAIL PROTECTED], blah, blew from table where blah > 1;
Thanks Emery ----- Original Message ----- From: "Diana Soares" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 16, 2003 19:41 Subject: RE: Challenging query.... > 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] > > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]