Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
Help in calc in Select |
Fri, Jan 19 2007 9:56 AM | Permanent Link |
Cicero S. Foscarini | Hello.
I need to make the same SELECT in DBIsam. Select ((select sum(estoque.quantidade) from estoque where estoque.produto = produtos.id) - ((select sum(consumo1.quantidade) from consumo1 where consumo1.cod_produto = produtos.id) + (select sum(consumo3.quantidade) from consumo3 where consumo3.cod_produto = produtos.id) + (select sum(consumo5.quantidade) from consumo5 where consumo5.cod_produto = produtos.id))) as saldo from produtos group by id How can I do this? Thanks |
Fri, Jan 19 2007 3:40 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Cicero,
<< I need to make the same SELECT in DBIsam. >> You'll need to split the SELECT statements out into individual SELECT statements that dump their results into a temporary table using the INTO clause like this: select produtos.id, sum(estoque.quantidade) as sum_quantidade into "\memory\temp1" from produtos, estoque where estoque.produto = produtos.id group by produtos.id and then as the final step you'll need to re-join them all again by the produtos.id column and perform the addition and subtraction of the summed columns. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |