On Thursday 26 Jun 2003 12:21 pm, Együd Csaba wrote: > Urgent Help : Use of return from function/procedure.Hi, > could anybody tell me what can be the difference between these queries? > There are a big difference but I can't understand the reasons. For some > reasons the firs query calculates getup column in a wrong way. It allways > devides with 10. (???) While the getupquantity column comes well. > > With the second query everything is ok.
1 > select (select getupquantity from t_products where id=productid) as 2 > getupquantity, 3 > quantity, 4 > (select quantity/getupquantity) as getup 5 > from t_stockchanges, t_products 6 > where (getupquantity<>0) 7 > limit 30; I don't think the t_products in the first line is the same as that in the fifth line - that'd surely mess up your values. -- Richard Huxton ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend