I have a database that records some data from ten customers in two hour intervals for two years. I'm looking to output a table that contains the sum of some readings for each customer.
The consumption table has all ten IDs, the injection one only has four of those ten. To achieve this I've used this query:
SELECT consumption.id_user as ID, SUM(consumption.value) as tot_con, SUM(injection.value) as tot_iny
FROM consumption
LEFT JOIN injection on ID = injection.id_user
GROUP BY ID
ORDER BY tot_iny DESC
When I run this query on SQLite Online I get the desired results: SQLite Online Result
When I run the same query in RMarkdown (With the RSQLite package) I get this: Markdown Result
R is placing the decimal point after the first digit in the first column for some reason; I can't even begin to conceptualize how to solve this.
It's even stranger since running a query for only that first column returns the correct result: First column only
I'd prefer to continue working in Markdown if possible, but I don't know if I'm doing something wrong, what's going on or how to fix it.
Any help is appreciated :)