SELECT min(date(`tx_date`)))) as start_date,
`account_id` as 'id'
FROM my_table
group by id
This is returning each tx_date and not grouping and giving me the min for each user. I’ve tried this for start_date as well: from_days(min(to_days(date(tx_date))))
I think the logic in your query is fine. Does you table
my_tablehas anidcolumn that is a primary key? The problem might be that the query is grouping by theidcolumn of your table rather thanidalias that you have used in your query.Try this if its
account_idyou want to GROUP on:I think your query has 2 extra closing braces around min(date(
tx_date)) and should be causing errors.