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
 

  • [fi... alauren...@gmail.com [firebird-support]
    • ... LtColRDSChauhan rdsc1...@gmail.com [firebird-support]
      • ... Рустам Муса-Ахунов rusta...@ukr.net [firebird-support]
        • ... alauren...@gmail.com [firebird-support]
      • ... Laurentiu Anisie alauren...@gmail.com [firebird-support]
        • ... Svein Erling Tysvær setys...@gmail.com [firebird-support]
          • ... alauren...@gmail.com [firebird-support]

Reply via email to