Bug with assignment operator ( := )

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SQL Statement:

select *,@xtotal := StkhistMonthqty06 + StkhistMonthqty07 + StkhistMonthqty08 as total
from StkMast as sm inner join StkHist as sh using (STkCode)
where (StkAuthor like 'keller%')
and (sh.StkhistYear='2004')
and (@xtotal>0);


Notice the use of @xtotal.

I have saved some output from an instance where I ran this query and it worked as expected.

Subsequently it has stopped finding any results. (the table has definitly NOT changed).
If I take out the and (@xtotal>0) clause, it finds records (and, whatsmore, I can see that xtotal is indeed greater than zero.


Does anyone know of any erratic behaviour when using the assignment operator?

Or am I doing something wrong?

(Note that this is actually the first time I have ever used the assignment operator, so I'm pretty green really)
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux