Subject Re: [firebird-support] Select with calculated field problem
Author Laurentiu Anisie
I don't have null's.

On Tue, Nov 28, 2017 at 4:27 PM, LtColRDSChauhan rdsc1964@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
 

Please check if you have null values.
Regards, 
Rajiv

On 28 Nov 2017 7:05 pm, "alaurentiu@... [firebird-support]" <firebird-support@yahoogroups. com> wrote:
 

Hi,


I have 2 tables and I want to select some data from them based on a common records. In the query, one of the column must be calculated as product of one field from table 1 and one field from table 2.

When I run the query, i get one row with the data without calculation, and one with calculation


The query is this:


SELECT A.CODSUB, A.CODOB, A.CODSBB, A.CANT*B.CANT FROM LSUBANS A,X01 B

WHERE A.CODSUB=B.CODSBB


LSUBANS

CODSUB  CODOB  CODSBB  CANT

SB3               EL8                         3


X01

CODSUB  CODOB  CODSBB  CANT

SB4                            SB3             3


the result of query had to be:

CODSUB  CODOB  CODSBB  CANT

SB3               EL8                         9


instead is:

CODSUB  CODOB  CODSBB  CANT

SB3               EL8                         3

SB3               EL8                         9


What I do wrong?


Thanks