Skip to content

Tag: sqlite

SQLite: Selecting multiple counts from one column

I am running a query with SQLite and am relatively new to this. Glance of my dataset: I want group the results by Col A and then show 3 more columns (mild, moderate, high) and their counts — Here is what I’m looking for: I know how I can select just one of the columns (say, mild), but not sure

Easy substraction of year’s values

I do have the following database table containing the timestamps in unix format as well as the total yield (summing up) of my solar panels every 5 mins: Now I would like to calculate how much energy was produced each year. I thought of reading the first and last timestamp using UNION of each year: This works …

Sqlite, using grouping? for subqueries with date ranges

I have a sqlite query that works as-is and it’s used to get an average of date between a date range Again, this works perfectly but I’d like to do some kind of subquery operation that does this same thing for every month and returns the result for each as a different alias like this but my issue i…