Re: What's wrong with user defined variable in this MySQL 5.1 example?

2009-01-19 Thread Baron Schwartz
> This means anytime a user defined variable like "@num := @num + 1" and is > used in a query that is sorted, it is going to have to be changed to a > subquery. For example, if someone was using it to display detail line item > numbers on an invoice, it now has to be turned into a subselect. This b

Re: What's wrong with user defined variable in this MySQL 5.1 example?

2009-01-19 Thread b
mos wrote: At 03:14 AM 1/19/2009, b wrote: mos wrote: I'm using MySQL 5.1.30 (WinXP) and user defined variables don't seem to be working properly if the Select statement is sorted. Here is a simple example: CREATE TABLE `tmp` ( `Purch_Date` date DEFAULT NULL, `Product` char

Re: What's wrong with user defined variable in this MySQL 5.1 example?

2009-01-19 Thread mos
At 03:14 AM 1/19/2009, b wrote: mos wrote: I'm using MySQL 5.1.30 (WinXP) and user defined variables don't seem to be working properly if the Select statement is sorted. Here is a simple example: CREATE TABLE `tmp` ( `Purch_Date` date DEFAULT NULL, `Product` char(10) DEFAULT

Re: What's wrong with user defined variable in this MySQL 5.1 example?

2009-01-19 Thread Baron Schwartz
On Mon, Jan 19, 2009 at 4:14 AM, b wrote: > mos wrote: >> >> I'm using MySQL 5.1.30 (WinXP) and user defined variables don't seem to be >> working properly if the Select statement is sorted. >> >> Here is a simple example: >> >> CREATE TABLE `tmp` ( >> `Purch_Date` date DEFAULT NULL, >>

Re: What's wrong with user defined variable in this MySQL 5.1 example?

2009-01-19 Thread b
mos wrote: I'm using MySQL 5.1.30 (WinXP) and user defined variables don't seem to be working properly if the Select statement is sorted. Here is a simple example: CREATE TABLE `tmp` ( `Purch_Date` date DEFAULT NULL, `Product` char(10) DEFAULT NULL ) ENGINE=MyISAM D

What's wrong with user defined variable in this MySQL 5.1 example?

2009-01-18 Thread mos
I'm using MySQL 5.1.30 (WinXP) and user defined variables don't seem to be working properly if the Select statement is sorted. Here is a simple example: CREATE TABLE `tmp` ( `Purch_Date` date DEFAULT NULL, `Product` char(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARS