lundi 9 novembre 2015

why sqlite returns row counts of while Join

sqlite returns row count while executing this query

SELECT sum(s.Card_10) ,sum(p.Card_10) FROM Sales_Table s ,  Purchase_Table p

ANSWER is sum(s.Card_10) 4 and sum(card_10) is 40

but if any execute these queries separately it reruns correct answer

Select sum(Card_10) from sales_table 

Answer 1 and

Select sum(Card_10) from Purchase_table 

Answer

40

why the error happen in such type of JOINS ?

Aucun commentaire:

Enregistrer un commentaire