Yes you are right. I run the query in SQLyog and it came very nicely. Thanks for your time and help.
Another question is: How do I send multiple queries at the same time the server? I mean, two instructions in the same query. Like SET @var = 0; SELECT (@var := @var + 1) AS Number, AnotherField FROM any_table_with_records; Thanks Emery ----- Original Message ----- From: "Petr Vileta" <[EMAIL PROTECTED]> To: "Director General: NEFACOMP" <[EMAIL PROTECTED]> Sent: Tuesday, September 23, 2003 18:55 Subject: Re: Using SQL variables > > Can you run this query and tell me if it works on your machine? > > SELECT (@var := @var + 1) AS Number, * FROM any_table_with_records; > > As per the manual, this should give something like: > > +---------------------- > > Number FieldOne > > 1 Value > > 2 Value > > 3 Value > > ... > > But when I run it the error is :You have an error in your SQL syntax near > > 'NULL @var + 1) AS Number BLAH BLAH BLAH > > Yeah :-) You are using MySQL-Front, is it right? I get the same error in > mysql-front but the syntax is right, test it using mysql.exe - a native > mysql client in DOS mode. If you will use this syntax in some program in > VisualBasic, PHP, Perl or other the command still work ok. > If you preffer GUI interface for work you can test SQLyog on www.webyog.com > > Petr Vileta, Czech republic > > > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]