>Hi
>
>Suppose I have an invoice(In) and invoice details(INdet) and I need some properties from the invoice and the total of the invoice from the invoice details
>
>The SQL Statement should be
>
>select In.ID,In.a,In.b,In.c,In.d,sum(InDet.value) as 'total' from In,Indet where In.ID=Indet.INID and In.ID='54321' group by id,a,b,c,d
>
>Is there a better way to do this?
>
>TIA
select ID,a,b,c,d, ;
total = (SELECT sum(value) FROM Indet WHERE INID = In.ID)
from In ;
where ID='54321'