SQLite Forum

Timeline
Login

3 forum posts by user Bshuyi

2021-07-09
07:34 Post: Join Multiple Table (artifact: 7a8bdf3db1 user: Bshuyi)

How to join multiple table as below example:

Table_1 LEFT JOIN Table_2 ON TABLE_1.Condition = TABLE_2.Condition

Table_2 LEFT JOIN Table_3 ON TABLE_2.Condition = TABLE_3.Condition

The 3 table have to join together to show result.

How should I query?

2021-07-02
05:35 Reply: Incorrect Result From SQLite Query (artifact: 3dcde1c579 user: Bshuyi)

SQLite Studio 3.2.1

Not always the last record in answer table.

It is in the between of the set of data.

03:50 Post: Incorrect Result From SQLite Query (artifact: 38d77b2c47 user: Bshuyi)

The result query from the SQLite is incorrect.

Some data are not being calculate by the formula but the data are included in the result table.

There are 10 row data, but only 9 row data is calculate, the another 1 row data is not calculate.

select (amount * rate) as cost

from report_A

Example:

Raw data: | Amount | Rate row 1 | 100 | 0.12 row 2 | 50 | 0.15 row 3 | 20 | 0.005 row 4 | 60 | 0.13 row 5 | 10 | 0.15 row 6 | 67 | 0.005 row 7 | 50 | 0.001 row 8 | 87 | 0.006 row 9 | 12 | 0.005 row 10 | 43 | 0.12

Result:

Amount Rate Cost
row 1 100 0.12 12
row 2 50 0.15 7.5
row 3 20 0.005 0.1
row 4 60 0.13 7.8
row 5 10 0.15 1.5
row 6 67 0.005 0.335
row 7 50 0.001 0.05
row 8 87 0.006 0.522
row 9 12 0.005 0.06
row 10 43 0.12 0

Expected Result:

Amount Rate Cost
row 1 100 0.12 12
row 2 50 0.15 7.5
row 3 20 0.005 0.1
row 4 60 0.13 7.8
row 5 10 0.15 1.5
row 6 67 0.005 0.335
row 7 50 0.001 0.05
row 8 87 0.006 0.522
row 9 12 0.005 0.06
row 10 43 0.12 5.16