Consider a scenario where you want to get a list of rows grouped by a column
select column-list
from table_name
where [conditions]
group by column1, column2...columnN
order by column1, column2...columnNFor Example, Let’s say you have transactions table with a schema like this
create table transactions(
id INTEGER PRIMARY KEY,
amount REAL NOT NULL,
note TEXT NOT NULL,
categoryId INTEGER NOT NULL,
time REAL NOT NULL,
created_at TEXT NOT NULL
)Now to get list of transactions grouped by each day, you can do something like this
SELECT
amount,
STRFTIME('%d-%m-%Y', transaction_time, 'unixepoch') AS 'transaction_time'
FROM
'transaction'
GROUP BY
STRFTIME('%d-%m-%Y', transaction_time, 'unixepoch')
order by amount desc